From eee2b7b7a81106191ecfeb4cc388326632559dff Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Sun, 4 Aug 2019 19:42:42 +0200 Subject: Improved gen script --- gen.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'gen.sh') diff --git a/gen.sh b/gen.sh index 5704ba3..cac39d9 100755 --- a/gen.sh +++ b/gen.sh @@ -1,15 +1,7 @@ #!/bin/sh -IDS=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s|" ${x%.svg.png}' {} \;` -FILES=`find . -type f -iname '*.png' -exec sh -c 'printf "%s|" ${0#./}' {} \;` +FILELIST=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s:%s|" ${x%.svg.png} $x' {} \;` -FILELIST="${IDS%|} -${FILES%|}" - -jq -Rn ' -( input | split("|") ) as $keys | -( inputs | split("|") ) as $vals | -[[$keys, $vals] | transpose[] | {key:.[0],value:.[1]}] | from_entries -' <<<"$FILELIST">blobfox.json +jq -Rn 'input | split("|") | map(split(":") | { key: .[0], value: .[1] }) | from_entries' <<<"${FILELIST%|}">blobfox.json zip blobfox.zip *.png -- cgit v1.2.3-54-g00ecf