diff options
| author | Feuerfuchs <git@feuerfuchs.dev> | 2019-08-04 19:42:42 +0200 | 
|---|---|---|
| committer | Feuerfuchs <git@feuerfuchs.dev> | 2019-08-04 19:42:42 +0200 | 
| commit | eee2b7b7a81106191ecfeb4cc388326632559dff (patch) | |
| tree | 88fa2d6e8d01871e54b42f1e1bcab609e370d1c4 | |
| parent | Created script to generate a Pleroma emoji pack (diff) | |
| download | blobfox-emojis-eee2b7b7a81106191ecfeb4cc388326632559dff.tar.gz blobfox-emojis-eee2b7b7a81106191ecfeb4cc388326632559dff.tar.bz2 blobfox-emojis-eee2b7b7a81106191ecfeb4cc388326632559dff.zip | |
Improved gen script
| -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 | 
