mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
Meta: Add helper for generating a C++ string from a text file
This commit is contained in:
parent
ea17b0cbb6
commit
40892ac72e
Notes:
sideshowbarker
2024-07-19 02:25:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/40892ac72e5
1 changed files with 11 additions and 0 deletions
11
Meta/text-to-cpp-string.sh
Executable file
11
Meta/text-to-cpp-string.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# $1 name of the variable
|
||||||
|
# $2 input path
|
||||||
|
|
||||||
|
echo "extern const char $1[];"
|
||||||
|
echo -n "const char $1[] = R\"("
|
||||||
|
grep -v '^ *#' < "$2" | while IFS= read -r line; do
|
||||||
|
echo "$line"
|
||||||
|
done
|
||||||
|
echo ")\";"
|
||||||
|
|
Loading…
Reference in a new issue