forked from vokal/Xcode-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·46 lines (35 loc) · 1.07 KB
/
install.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# This is basically the install script from reidmain/Xcode-6-Project-Templates #
folderName="Vokal"
# The name of the base project template
baseTemplate="Vokal-Cocoa Touch Application Base"
if [ "$#" -eq 1 ]; then
folderName="$1"
elif [ "$#" -gt 1 ]; then
echo -e "This script takes one argument at most.\\ne.g. install.sh \"Vokal\""
exit 1
fi
installDirectory=~/Library/Developer/Xcode/Templates/Project\ Templates/"${folderName}"
echo "Templates will be installed to ${installDirectory}"
if [ -d "${installDirectory}" ]; then
rm -r "${installDirectory}"
fi
mkdir -p "${installDirectory}"
cp -r *.xctemplate "${installDirectory}"
# Create empty directories in the base template folder for common directory structure
declare -a emptyDirectories=(
"Categories"
"Controls"
"Data Sources"
"Extensions"
"Flows"
"Fonts"
"Resources"
"Scripts"
"Utilities"
"Views"
"View Controllers"
)
for directory in "${emptyDirectories[@]}"; do
mkdir -p "${installDirectory}/${baseTemplate}.xctemplate/${directory}"
done