]> Nishi Git Mirror - gwion.git/commitdiff
:bug: embed script
authorfennecdjay <fennecdjay@gmail.com>
Tue, 28 Feb 2023 14:40:17 +0000 (15:40 +0100)
committerfennecdjay <fennecdjay@gmail.com>
Tue, 28 Feb 2023 14:40:17 +0000 (15:40 +0100)
scripts/embed.bash

index 915167da097ea0bca7a675504a0399842ab3905a..fe213b1de6cab2854e4f95e0741a184afb12c5c8 100644 (file)
@@ -122,12 +122,15 @@ jq -rc '.[]' <<< "$libraries" |
   done
 }
 
+file2hex() {
+  cp "$1" "$2"
+  xxd -i "$2" > "embed/${2}.h"
+  rm "$2"
+}
+
 handle_script() {
   name="script$2"
-  xxd -name "$name" -i "$1" > "embed/${name}.h" || {
-    echo "$1 missing. aborting" >&2
-    exit 1
-  }
+  file2hex "$1" "$name"
   header "#include \"${name}.h\""
   echo "  compile_script(gwion, \"$name\", (m_str)${name}, ${name}_len);"
 }