diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | gen.sh | 15 |
2 files changed, 17 insertions, 0 deletions
@@ -1 +1,3 @@ | |||
1 | *.png | 1 | *.png |
2 | *.json | ||
3 | *.zip | ||
@@ -0,0 +1,15 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | IDS=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s|" ${x%.svg.png}' {} \;` | ||
4 | FILES=`find . -type f -iname '*.png' -exec sh -c 'printf "%s|" ${0#./}' {} \;` | ||
5 | |||
6 | FILELIST="${IDS%|} | ||
7 | ${FILES%|}" | ||
8 | |||
9 | jq -Rn ' | ||
10 | ( input | split("|") ) as $keys | | ||
11 | ( inputs | split("|") ) as $vals | | ||
12 | [[$keys, $vals] | transpose[] | {key:.[0],value:.[1]}] | from_entries | ||
13 | ' <<<"$FILELIST">blobfox.json | ||
14 | |||
15 | zip blobfox.zip *.png | ||