Created
June 29, 2020 08:22
-
-
Save loranger/df6fc87eabc5b96d58a5c9290ada9953 to your computer and use it in GitHub Desktop.
Get latest unicons release and convert svg as png
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
rm -rf line | |
mkdir -p line | |
cd line | |
# Get latest release | |
echo "Finding latest release" | |
LOCATION=$(curl -s https://api.github.com/repos/Iconscout/unicons/releases/latest \ | |
| grep "tag_name" \ | |
| awk '{print "https://github.com/Iconscout/unicons/archive/" substr($2, 2, length($2)-3) ".zip"}') | |
# Download release | |
echo "Downloading latest release" | |
curl -s -L -o archive.zip $LOCATION | |
# Unzip svg line icons | |
echo "Extracting latest release" | |
unzip -jq archive.zip '*/svg/line/*' -d extract | |
# Convert svg to png | |
echo "Converting SVG files" | |
mogrify -background none -density 2304 -format png extract/*.svg | |
# Remove all svg | |
echo "Cleaning files" | |
rm archive.zip | |
# rm extract/*.svg | |
mv extract/*.png . | |
rm -rf extract |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment