True Collaboration via Git and Sketch Is Finally Here
Andree @blended.io
794

#!/bin/sh
SKETCHTOOL=/Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool
for SKETCHFILE in *.sketch; do
FOLDER=$(basename ${SKETCHFILE} ".sketch")
unzip -o ${SKETCHFILE} -d ${FOLDER}
${SKETCHTOOL} export artboards ${SKETCHFILE} --use-id-for-name="YES" --overwriting="YES" --output="${FOLDER}/artboards"

JSONS=$(find ${FOLDER} -name *.json)
for JSON in ${JSONS}; do
TEMPFILE=_$(basename ${JSON} ".json")
python -m json.tool ${JSON} > ${TEMPFILE}
mv ${TEMPFILE} ${JSON}
done
git add ${FOLDER}

git rm --cached ${SKETCHFILE}
done

pre-commit githook.

Show your support

Clapping shows how much you appreciated Ashung Hung’s story.