-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·48 lines (34 loc) · 1.19 KB
/
install
File metadata and controls
executable file
·48 lines (34 loc) · 1.19 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
#!/bin/bash
set -e
source env.zsh
TEMPLATEDIR="$HOME/Library/Developer/Xcode/Templates"
ISUPDATE=0
./setsdk
if [ $? -ne 0 ]; then
echoRed "ERROR: Failed to set up templates with research SDK"
exit 1
fi
if [ ! -f "$TEMP_RESEARCH_TEMPLATES_FILE" ]; then
echoRed "ERROR: Temporary file not found at '$TEMP_RESEARCH_TEMPLATES_FILE'. Something's wrong with the setsdk script!"
exit 1
fi
SOURCEDIR=$(cat temp.txt)
rm temp.txt 2>/dev/null || true
if [ ! -d "$SOURCEDIR" ]; then
echo "Research directory not found in $SOURCEDIR, please run this script from within the srd-xcode-templates project directory"
exit 1
fi
if [ ! -d "$TEMPLATEDIR" ]; then
echo "Creating Templates directory at $TEMPLATEDIR"
mkdir -p "$TEMPLATEDIR" || { echo "Failed to create templates directory at $TEMPLATEDIR"; exit 1; }
fi
if [ -d "$TEMPLATEDIR/Research" ]; then
ISUPDATE=1
fi
echo "Installing Research templates"
cp -Rf "$SOURCEDIR" "$TEMPLATEDIR" || { echo "Failed to copy Research directory into Templates directory"; exit 1; }
if [ $ISUPDATE -eq 1 ]; then
echo "Templates updated! Restart Xcode before using them."
else
echo "Templates installed! Restart Xcode before using them."
fi