forked from reidmain/Xcode-File-Templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·28 lines (22 loc) · 713 Bytes
/
install.sh
File metadata and controls
executable file
·28 lines (22 loc) · 713 Bytes
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
#!/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/File\ 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.
cp -r *.xctemplate "$installDirectory"