diff options
Diffstat (limited to 'gen.sh')
-rwxr-xr-x | gen.sh | 12 |
1 files changed, 2 insertions, 10 deletions
@@ -1,15 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | IDS=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s|" ${x%.svg.png}' {} \;` | 3 | FILELIST=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s:%s|" ${x%.svg.png} $x' {} \;` |
4 | FILES=`find . -type f -iname '*.png' -exec sh -c 'printf "%s|" ${0#./}' {} \;` | ||
5 | 4 | ||
6 | FILELIST="${IDS%|} | 5 | jq -Rn 'input | split("|") | map(split(":") | { key: .[0], value: .[1] }) | from_entries' <<<"${FILELIST%|}">blobfox.json |
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 | 6 | ||
15 | zip blobfox.zip *.png | 7 | zip blobfox.zip *.png |