-
Notifications
You must be signed in to change notification settings - Fork 35
/
install.sh
executable file
·58 lines (50 loc) · 2.52 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
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
# Default the folder name to "1414 Degrees".
folderName="1414 Degrees"
# Ensure that at most one argument has been passed in.
if [ "$#" -eq 1 ]
then
folderName=$1
elif [ "$#" -gt 1 ]
then
echo -e "This script takes one argument at most.\\ne.g. install.sh \"1414 Degrees\""
exit 1
fi
# Determine the install directory.
installDirectory=~/Library/Developer/Xcode/Templates/Project\ Templates/"$folderName"
echo "Templates will be installed to $installDirectory"
# Delete the install directory if it already exists to prevent deleted files from lingering.
if [ -d "$installDirectory" ]
then
rm -r "$installDirectory"
fi
# Create the install directory.
mkdir -p "$installDirectory"
# Copy all of the xctemplate folders into the install directory.
cp -r *.xctemplate "$installDirectory"
# Create empty directories that the project templates will copy.
mkdir -p "$installDirectory"/"Base.xctemplate/Supporting Files/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Vendors/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Common/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Classes/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Controllers/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Categories/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Controls/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Views/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Resources/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Models/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Managers/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/Services/"
mkdir -p "$installDirectory"/"iOS Application.xctemplate/HockeyApp/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Vendors/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Common/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Classes/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Controllers/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Categories/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Controls/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Views/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Resources/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Models/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Managers/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/Services/"
mkdir -p "$installDirectory"/"OS X Application.xctemplate/HockeyApp/"