mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-01 12:00:27 +00:00
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 ")~~~\";"
|