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 | |
parent | Add salad to burger (diff) | |
download | blobfox-emojis-4d1b7bc84048633edb5fcc915a459d982b28e368.tar.gz blobfox-emojis-4d1b7bc84048633edb5fcc915a459d982b28e368.tar.bz2 blobfox-emojis-4d1b7bc84048633edb5fcc915a459d982b28e368.zip |
Improved gen script
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | LICENSE | 13 | ||||
-rwxr-xr-x | gen.sh | 26 |
3 files changed, 31 insertions, 12 deletions
@@ -1,3 +1 @@ | |||
1 | *.png | export | |
2 | *.json | ||
3 | *.zip | ||
@@ -0,0 +1,13 @@ | |||
1 | Copyright 2019 Feuerfuchs <me@feuerfuchs.dev> (https://www.feuerfuchs.dev/) | ||
2 | |||
3 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
4 | you may not use this file except in compliance with the License. | ||
5 | You may obtain a copy of the License at | ||
6 | |||
7 | http://www.apache.org/licenses/LICENSE-2.0 | ||
8 | |||
9 | Unless required by applicable law or agreed to in writing, software | ||
10 | distributed under the License is distributed on an "AS IS" BASIS, | ||
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
12 | See the License for the specific language governing permissions and | ||
13 | limitations under the License. | ||
@@ -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 | ||