forked from ColdLogical/VIPER-Templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·32 lines (24 loc) · 1.01 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
TEMPLATE_DIRECTORY=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
XCODE_DIR=$1
if [ -z $XCODE_DIR ]; then
echo "Please input the path to your Xcode Application"
read -p "Press return to use the default /Applications/Xcode.app/: " XCODE_DIR
fi
if [ -z $XCODE_DIR ]; then
XCODE_DIR="/Applications/Xcode.app/"
fi
SOURCE_DIRECTORY="${XCODE_DIR}Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Source/"
echo "Installing templates to:"
echo "$SOURCE_DIRECTORY"
if [ -d "$SOURCE_DIRECTORY" ]; then
eval cd '"$SOURCE_DIRECTORY"'
echo "Creating symbolic links to"
echo ${TEMPLATE_DIRECTORY}
sudo ln -sfn "${TEMPLATE_DIRECTORY}/VIPER.xctemplate" VIPER.xctemplate
sudo ln -sfn "${TEMPLATE_DIRECTORY}/VIPER Tests.xctemplate" "VIPER Tests.xctemplate"
echo "Done"
else
echo "Uh OHHHH that source directory does not exist!!!"
echo "Aborting. Please check your Xcode app path and try again"
fi