Add TS code embedding

This commit is contained in:
2025-12-03 18:32:35 +01:00
parent 35b16bfc49
commit e3dce14c64
7 changed files with 34 additions and 8 deletions

12
src/scripts/embed_system.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
set -e
echo "#ifndef SYSTEM_PROG_H" > out/system/system_prog.h
echo "#define SYSTEM_PROG_H" >> out/system/system_prog.h
echo "const char* SYSTEM_PROG_JS = \\" >> out/system/system_prog.h
while IFS= read -r line; do
ESCAPED_LINE=$(echo "$line" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g')
echo "\"${ESCAPED_LINE}\\n\"" >> out/system/system_prog.h
done < out/system/index.js
echo ";" >> out/system/system_prog.h
echo "#endif" >> out/system/system_prog.h