From: fennecdjay Date: Tue, 28 Feb 2023 14:40:17 +0000 (+0100) Subject: :bug: embed script X-Git-Tag: nightly~186 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=dc2baf63ef1107a679af766805dc176dddbf2284;p=gwion.git :bug: embed script --- 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);" }