Created
August 21, 2018 14:26
-
-
Save kyleknighted/f9fa682aa30fb5f739f5d6bdda12b562 to your computer and use it in GitHub Desktop.
Automating SVG Icon Management with Sketch and Makefiles
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 | |
readme=./src/assets/README.md | |
echo -n > $readme # clears or creates empty file | |
echo "# Icons" >> $readme # h1 title of README document | |
echo "| preview | name |" >> $readme # column names for table | |
echo "|:----:| ---- |" >> $readme # center align preview image and left align name | |
# loop through all icons | |
for filename in src/assets/icons/*.svg ; do \ | |
# get filename of icon without path or ".svg" extension | |
icon=$(basename $filename .svg) ; \ | |
# build the row in the table | |
echo "|<img src=\"icons/$icon.svg\" alt=\"$icon\" width=\"24px\"/>|$icon|" >> $readme ; \ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment