From dc2baf63ef1107a679af766805dc176dddbf2284 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 28 Feb 2023 15:40:17 +0100 Subject: [PATCH] :bug: embed script --- scripts/embed.bash | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/embed.bash b/scripts/embed.bash index 915167da..fe213b1d 100644 --- a/scripts/embed.bash +++ b/scripts/embed.bash @@ -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);" } -- 2.43.0