* Improved existing scripts
* Made a global make-all script * Added missing jsons to cards
This commit is contained in:
18
make-frame.sh
Executable file
18
make-frame.sh
Executable 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"
|
||||
Reference in New Issue
Block a user