From 4356e4d76552fa40a9dc77a4fc8db66ef6e29a8e Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Tue, 6 Aug 2019 00:07:03 +0200 Subject: [PATCH] Generate flipped versions --- .gitignore | 1 + gen.sh | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d563759..2af4361 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ export +export_flip diff --git a/gen.sh b/gen.sh index a30dfb5..6ea034e 100755 --- a/gen.sh +++ b/gen.sh @@ -3,19 +3,42 @@ mkdir -p export rm -f export/* +mkdir -p export_flip +rm -f export_flip/* + find . -type f -iname '*.svg' -print0 | parallel -0 'x={.}; inkscape -z -e "export/${x#./}.png" "{}"' {} \; cp LICENSE export/ +cp export/* export_flip/ cd export FILELIST=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s:%s|" ${x%.png} $x' {} \;` jq -Rn 'input | split("|") | map(split(":") | { key: .[0], value: .[1] }) | from_entries' <<< "${FILELIST%|}" > blobfox.json -rm -f blobfox.zip zip blobfox.zip *.png zip blobfox.zip LICENSE CHECKSUM=`sha256sum -z blobfox.zip | awk '{ print $1 }'` +cd ../export_flip + +rm blobfoxsign*.png +find . -type f -iname '*.png' -exec sh -c 'x=${0#./blobfox}; mv blobfox$x blobfoxflip$x' {} \; +mogrify -flop *.png +FILELIST=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s:%s|" ${x%.png} $x' {} \;` +jq -Rn 'input | split("|") | map(split(":") | { key: .[0], value: .[1] }) | from_entries' <<< "${FILELIST%|}" > blobfox_flip.json + +zip blobfox_flip.zip *.png +zip blobfox_flip.zip LICENSE +CHECKSUM_FLIP=`sha256sum -z blobfox_flip.zip | awk '{ print $1 }'` + +cd ../export + +mv ../export_flip/blobfox_flip.zip ./ +mv ../export_flip/blobfox_flip.json ./ + +rm -f *.png +rm -f ../export_flip/* + printf '{ "blobfox": { "description": "Like Blobcat, but with foxes", @@ -24,5 +47,13 @@ printf '{ "src": "https://www.feuerfuchs.dev/projects/blobfox-emojis/blobfox.zip", "src_sha256": "%s", "license": "Apache 2.0" + }, + "blobfox_flip": { + "description": "Like Blobcat, but with foxes (flipped version)", + "files": "blobfox_flip.json", + "homepage": "https://www.feuerfuchs.dev/projects/blobfox-emojis/", + "src": "https://www.feuerfuchs.dev/projects/blobfox-emojis/blobfox_flip.zip", + "src_sha256": "%s", + "license": "Apache 2.0" } -}' $CHECKSUM > manifest.json +}' $CHECKSUM $CHECKSUM_FLIP > manifest.json