mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:22:43 +00:00 
			
		
		
		
	 7ad31651bd
			
		
	
	
		7ad31651bd
		
	
	
	
	
		
			
			Previously we had /bin/sh, which might be bash but is run in POSIX mode on some systems, causing read -r to not work correctly and inserting newlines when encountering literal "\n" in the source. Fixes #5040.
		
			
				
	
	
		
			10 lines
		
	
	
	
		
			221 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			10 lines
		
	
	
	
		
			221 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| # $1 name of the variable
 | |
| # $2 input path
 | |
| 
 | |
| echo "extern const char $1[];"
 | |
| printf "const char %s[] = R\"~~~(" "$1"
 | |
| grep -v '^ *#' < "$2" | while IFS= read -r line; do
 | |
|   echo "$line"
 | |
| done
 | |
| echo ")~~~\";"
 |