diff options
Diffstat (limited to '')
-rwxr-xr-x | scripts/embed-lua.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/embed-lua.sh b/scripts/embed-lua.sh new file mode 100755 index 0000000..80f6cba --- /dev/null +++ b/scripts/embed-lua.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +# Clean unnecessary stuff from the lua file; note the significant tabulator. +alias strip="sed -e 's/^[ ]*//g; s/ */ /g; /^--/d; /^$/d'" +if command -v xxd > /dev/null 2>&1; then + strip < "$1" | xxd -i - +else + strip < "$1" | hexdump -v -e '/1 "0x%02X, " " "' +fi +exit $? |