From 4d1b7bc84048633edb5fcc915a459d982b28e368 Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Mon, 5 Aug 2019 21:16:42 +0200 Subject: Improved gen script --- .gitignore | 4 +--- LICENSE | 13 +++++++++++++ gen.sh | 26 +++++++++++++++++--------- 3 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore index 6396bb2..d563759 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -*.png -*.json -*.zip +export diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5238b5a --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ +Copyright 2019 Feuerfuchs (https://www.feuerfuchs.dev/) + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/gen.sh b/gen.sh index 14af53c..543b60a 100755 --- a/gen.sh +++ b/gen.sh @@ -1,18 +1,26 @@ #!/bin/sh -FILELIST=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s:%s|" ${x%.png} $x' {} \;` +mkdir -p 'export' +find . -type f -iname '*.svg' -print0 | parallel -0 'x={.}; inkscape -z -e "export/${x#./}.png" "{}"' {} \; +cp LICENSE export/ + +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 blobfox.zip +rm -f blobfox.zip zip blobfox.zip *.png - +zip blobfox.zip LICENSE CHECKSUM=`sha256sum -z blobfox.zip | awk '{ print $1 }'` printf '{ - "src": "https://git.pleroma.social/pleroma/emoji-index/raw/master/packs/blobfox.zip", - "src_sha256": "%s", - "license": "Apache 2.0", - "files": "blobfox.json", - "description": "Like Blobcat, except with foxes" -}' $CHECKSUM > index.json + "blobfox": { + "description": "Like Blobcat, but with foxes", + "files": "blobfox.json", + "homepage": "https://www.feuerfuchs.dev/projects/blobfox-emojis/", + "src": "https://www.feuerfuchs.dev/projects/blobfox-emojis/blobfox.zip", + "src_sha256": "%s", + "license": "Apache 2.0" + } +}' $CHECKSUM > manifest.json -- cgit v1.2.3-70-g09d2