mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
![Linus Groh](/assets/img/avatar_default.png)
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 ")~~~\";"
|