Created
August 7, 2017 03:31
-
-
Save d4rekanguok/680d80f1e2695031537f092f752a67f5 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# sh /Applications/Sketch.app/Contents/Resources/sketchtool/install.sh | |
# npm install -g svgo s2v | |
if [ -z "$1" ]; then | |
SOURCEDIR=. | |
else | |
SOURCEDIR=$1 | |
fi | |
if [ ! -d "$SOURCEDIR/svgmin" ]; then | |
mkdir $SOURCEDIR/svgmin | |
fi | |
if [ ! -d "$SOURCEDIR/drawable" ]; then | |
mkdir $SOURCEDIR/drawable | |
fi | |
sketchtool export slices ./*.sketch | |
rm -rf $SOURCEDIR/svgmin $SOURCEDIR/drawable && mkdir $SOURCEDIR/svgmin $SOURCEDIR/drawable | |
svgo -f $SOURCEDIR -o $SOURCEDIR/svgmin && s2v $SOURCEDIR/svgmin $SOURCEDIR/drawable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment