forked from lmr001/XCode-Project-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·40 lines (30 loc) · 936 Bytes
/
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
#!/usr/bin/env bash
echo ""
echo ""
# Default the folder name to "Custom Template".
folderName="Custom Template"
# 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 \"Custom Template\""
exit 1
fi
# Determine the install directory.
installDirectory=~/Library/Developer/Xcode/Templates/Project\ Templates/"$folderName"
echo "Templates will be installed to $installDirectory"
# Create the install directory if it does not exist.
if [ ! -d "$installDirectory" ]
then
mkdir -p "$installDirectory"
fi
# Copy all of the xctemplate folders into the install directory.
#mkdir "$installDirectory"
# Create empty directories that the project templates will copy.
#mkdir "$installDirectory"/"Base.xctemplate/Supporting Files/"
cp -r "custom template"/* "$installDirectory"/
echo ""
echo ""
echo "DONE!"