From fd0ad6e5218c2098c266daf5891a3b669fd1a490 Mon Sep 17 00:00:00 2001 From: JohnnyB Date: Tue, 30 Jan 2024 17:56:21 +0000 Subject: [PATCH] Changed ugly xxd to literals. HPP files are much more readable as multiline literals rather than hex arrays. --- examples/server/deps.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/server/deps.sh b/examples/server/deps.sh index ea23e6450..c8479f390 100755 --- a/examples/server/deps.sh +++ b/examples/server/deps.sh @@ -16,5 +16,12 @@ for FILE in $FILES; do echo "generate $FILE.hpp" # use simple flag for old version of xxd - xxd -i $FILE > $DIR/$FILE.hpp + f=$(echo $FILE | sed 's/\./_/g') + echo "const char $f[] = R\"LITERAL(" > $DIR/$FILE.hpp + cat $FILE >> $DIR/$FILE.hpp + echo ")LITERAL\";" >> $DIR/$FILE.hpp + echo "unsigned int ${f}_len = sizeof($f);" >> $DIR/$FILE.hpp + + #Deprecated old xxd + #xxd -i $FILE > $DIR/$FILE.hpp done