Last active
June 15, 2016 07:41
-
-
Save lajlev/f5ee1e2e2e315f5274b10ec6d9ca93a0 to your computer and use it in GitHub Desktop.
Revisions
-
lajlev revised this gist
Jun 15, 2016 . 1 changed file with 11 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,10 +7,16 @@ # A: It creates a .exportArtboards folder with all artboards as PNGs, # so you easily can see changes in GIT 🎊. git diff --cached --name-status | while read STATE FILE; do # Skip deleted files if [ "$STATE" == 'D' ]; then continue; fi # Do a check only on the sketch files files if [[ ${FILE: -7} == ".sketch" ]]; then DIR=$(dirname "${FILE}") sketchtool export artboards $FILE --output="${DIR}/.exportArtboards" --overwriting=YES --trimmed=NO --save-for-web=YES git add ${DIR}/.exportArtboards fi done -
lajlev created this gist
Jun 14, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/bin/sh # Requires sketch and Sketchtool # Q: How to enable it? # A: Add it to your repo pre-commit hook # Q: What does it do? # A: It creates a .exportArtboards folder with all artboards as PNGs, # so you easily can see changes in GIT 🎊. SKETCHFILES=$(git diff-index --cached HEAD | grep ".sketch" | grep "^:" | sed 's:.*[DAM][ \\''t]*\([^ \\''t]*\):\1:g'); for FILE in $SKETCHFILES do sketchtool export artboards $FILE --output=".exportArtboards" --overwriting=YES --trimmed=NO --save-for-web=YES git add .exportArtboards done