diff options
| author | Feuerfuchs <git@feuerfuchs.dev> | 2019-08-05 21:16:42 +0200 |
|---|---|---|
| committer | Feuerfuchs <git@feuerfuchs.dev> | 2019-08-05 21:16:42 +0200 |
| commit | 4d1b7bc84048633edb5fcc915a459d982b28e368 (patch) | |
| tree | 30c36ba1ef7dbe80393bbeee6996ac7ed8db53d1 /gen.sh | |
| parent | Add salad to burger (diff) | |
| download | blobfox-emojis-4d1b7bc84048633edb5fcc915a459d982b28e368.tar.gz blobfox-emojis-4d1b7bc84048633edb5fcc915a459d982b28e368.tar.bz2 blobfox-emojis-4d1b7bc84048633edb5fcc915a459d982b28e368.zip | |
Improved gen script
Diffstat (limited to 'gen.sh')
| -rwxr-xr-x | gen.sh | 26 |
1 files changed, 17 insertions, 9 deletions
| @@ -1,18 +1,26 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | FILELIST=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s:%s|" ${x%.png} $x' {} \;` | 3 | mkdir -p 'export' |
| 4 | find . -type f -iname '*.svg' -print0 | parallel -0 'x={.}; inkscape -z -e "export/${x#./}.png" "{}"' {} \; | ||
| 5 | cp LICENSE export/ | ||
| 6 | |||
| 7 | cd export | ||
| 4 | 8 | ||
| 9 | FILELIST=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s:%s|" ${x%.png} $x' {} \;` | ||
| 5 | jq -Rn 'input | split("|") | map(split(":") | { key: .[0], value: .[1] }) | from_entries' <<< "${FILELIST%|}" > blobfox.json | 10 | jq -Rn 'input | split("|") | map(split(":") | { key: .[0], value: .[1] }) | from_entries' <<< "${FILELIST%|}" > blobfox.json |
| 6 | 11 | ||
| 7 | rm blobfox.zip | 12 | rm -f blobfox.zip |
| 8 | zip blobfox.zip *.png | 13 | zip blobfox.zip *.png |
| 9 | 14 | zip blobfox.zip LICENSE | |
| 10 | CHECKSUM=`sha256sum -z blobfox.zip | awk '{ print $1 }'` | 15 | CHECKSUM=`sha256sum -z blobfox.zip | awk '{ print $1 }'` |
| 11 | 16 | ||
| 12 | printf '{ | 17 | printf '{ |
| 13 | "src": "https://git.pleroma.social/pleroma/emoji-index/raw/master/packs/blobfox.zip", | 18 | "blobfox": { |
| 14 | "src_sha256": "%s", | 19 | "description": "Like Blobcat, but with foxes", |
| 15 | "license": "Apache 2.0", | 20 | "files": "blobfox.json", |
| 16 | "files": "blobfox.json", | 21 | "homepage": "https://www.feuerfuchs.dev/projects/blobfox-emojis/", |
| 17 | "description": "Like Blobcat, except with foxes" | 22 | "src": "https://www.feuerfuchs.dev/projects/blobfox-emojis/blobfox.zip", |
| 18 | }' $CHECKSUM > index.json | 23 | "src_sha256": "%s", |
| 24 | "license": "Apache 2.0" | ||
| 25 | } | ||
| 26 | }' $CHECKSUM > manifest.json | ||
