* Improved existing scripts

* Made a global make-all script
* Added missing jsons to cards
This commit is contained in:
2025-08-08 05:09:14 -05:00
parent d4b7828e0d
commit 8f00a867fd
17 changed files with 147 additions and 59 deletions

18
make-frame.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
TARGET_DIRECTORY=${TARGET_DIRECTORY?-out}
INPUT=$1
_BASEDIR=`basename $INPUT`
PACK=${_BASEDIR%.*}
printf "{\"$PACK\":{" > "$TARGET_DIRECTORY/$PACK.json"
OUTNAME="$(sha256sum "$1" | awk '{ print $1 }').${1##*.}"
cp "$1" "$TARGET_DIRECTORY/$OUTNAME"
echo "Writing frame '$PACK'..."
printf "\"frame\":\"$OUTNAME\"," >> "$TARGET_DIRECTORY/$PACK.json"
if [ ! -z $5 ]; then
printf "\"size\":[$2,$3,$4,$5]" >> "$TARGET_DIRECTORY/$PACK.json"
elif [ ! -z $3 ]; then
printf "\"size\":[$2,$3]" >> "$TARGET_DIRECTORY/$PACK.json"
else
printf "\"size\":[$2]" >> "$TARGET_DIRECTORY/$PACK.json"
fi
printf "}}" >> "$TARGET_DIRECTORY/$PACK.json"