Created
August 27, 2015 05:50
-
-
Save daneden/884dc882351eecf38002 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 | |
# Let's get some color going! | |
red=$'\e[1;31m' | |
grn=$'\e[1;32m' | |
end=$'\e[0m' | |
# cd to cwd of the script (presumably in it's proper location) | |
cd "$(dirname "$0")" | |
printf "\nInstalling Sketch templates..." | |
# Install for App Store/Stable Sketch | |
if [ -d "$HOME/Library/Application Support/com.bohemiancoding.sketch3/" ]; then | |
path="$HOME/Library/Application Support/com.bohemiancoding.sketch3/" | |
ditto "Web - Blankslates.sketch" "${path}Templates/Dropbox Web.sketch" | |
ditto "Mobile - iOS - Blankslates.sketch" "${path}Templates/Dropbox iOS.sketch" | |
mv "${path}assets-v55.sketchpreset" "${path}assets-v55.sketchpreset.backup" | |
ditto "Web - Colors.sketchpreset" "${path}assets-v55.sketchpreset" | |
fi | |
if [ -d "$HOME/Library/Containers/com.bohemiancoding.sketch3/" ]; then | |
path="$HOME/Library/Containers/com.bohemiancoding.sketch3/Data/Library/Application Support/com.bohemiancoding.sketch3/" | |
ditto "Web - Blankslates.sketch" "${path}Templates/Dropbox Web.sketch" | |
ditto "Mobile - iOS - Blankslates.sketch" "${path}Templates/Dropbox iOS.sketch" | |
mv "${path}assets-v55.sketchpreset" "${path}assets-v55.sketchpreset.backup" | |
ditto "Web - Colors.sketchpreset" "${path}assets-v55.sketchpreset" | |
fi | |
# Install for Sketch Beta | |
if [ -d "$HOME/Library/Containers/com.bohemiancoding.sketch3.beta/" ]; then | |
path="$HOME/Library/Containers/com.bohemiancoding.sketch3.beta/Data/Library/Application Support/com.bohemiancoding.sketch3/" | |
ditto "Web - Blankslates.sketch" "${path}Templates/Dropbox Web.sketch" | |
ditto "Mobile - iOS - Blankslates.sketch" "${path}Templates/Dropbox iOS.sketch" | |
mv "${path}assets-v55.sketchpreset" "${path}assets-v55.sketchpreset.backup" | |
ditto "Web - Colors.sketchpreset" "${path}assets-v55.sketchpreset" | |
printf "\nInstalling templates for Sketch Beta..." | |
fi | |
# Catch errors or confirm success | |
if [ ! -d "$HOME/Library/Containers/com.bohemiancoding.sketch3/" ] && [ ! -d "$HOME/Library/Containers/com.bohemiancoding.sketch3.beta/" ]; then | |
printf "\n\n${red}Welp. Couldn't install the templates.${end}" | |
printf "\nMake sure Sketch is installed or contact [email protected].\n" | |
else | |
printf "\n\n${grn}Done! \nIf something seems awry, contact [email protected]. It's his fault.${end}\n" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment