mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03: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.
11 lines
221 B
Bash
Executable File
11 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 ")~~~\";"
|