Improved gen script

master
Feuerfuchs 5 years ago
parent ec4530c495
commit 4d1b7bc840
No known key found for this signature in database
GPG Key ID: 9953BC7CB26FB049

4
.gitignore vendored

@ -1,3 +1 @@
*.png
*.json
*.zip
export

@ -0,0 +1,13 @@
Copyright 2019 Feuerfuchs <me@feuerfuchs.dev> (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.

@ -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

Loading…
Cancel
Save