-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.command
More file actions
executable file
·48 lines (37 loc) · 1.03 KB
/
install.command
File metadata and controls
executable file
·48 lines (37 loc) · 1.03 KB
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
#!/usr/bin/env bash
echo ""
echo "******************************************************"
# Default the folder name to "Custom Template".
folderName="Custom Template"
echo ""
echo ""
# 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"
echo ""
# 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"
ABSPATH=$(cd "$(dirname "$0")"; pwd)
#echo "ABSPATH ${ABSPATH}"
#echo ""
#echo ""
cp -r "${ABSPATH}/custom template"/* "$installDirectory"/
echo ""
echo ""
echo "DONE!"
echo ""
echo "******************************************************"