-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·144 lines (106 loc) · 4.06 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/sh
IOS_FILE_TEMPLATE_SOURCE_DIR="./Source/FileTemplates-iOS"
IOS_FILE_TEMPLATE_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates"
TVOS_FILE_TEMPLATE_SOURCE_DIR="./Source/FileTemplates-tvOS"
TVOS_FILE_TEMPLATE_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/Templates/File Templates"
PROJECT_TEMPLATE_SOURCE_DIR_iOS="./Source/ProjectTemplates/iOS"
PROJECT_TEMPLATE_DIR_iOS="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/iOS/Application"
PROJECT_TEMPLATE_SOURCE_DIR_tvOS="./Source/ProjectTemplates/tvOS"
PROJECT_TEMPLATE_DIR_tvOS="/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Xcode/Templates/Project Templates/AppleTVOS/Application"
XCODE_SNIPPETS_SOURCE_DIR="./Source/CodeSnippets"
XCODE_SNIPPETS_TARGET_DIR="$HOME/Library/Developer/Xcode/UserData/CodeSnippets"
project_template_array=(
"XCode-DI.xctemplate"
"XCode-DI-Base.xctemplate")
ios_file_template_array=(
"View Controller.xctemplate"
"View.xctemplate"
"Collection ViewController.xctemplate"
"CollectionView Cell.xctemplate"
"Video ViewController.xctemplate"
"Service.xctemplate"
"Network Service.xctemplate"
"Transitioning Container VC.xctemplate"
"Transitioning Context.xctemplate"
"Transitioning Animator.xctemplate"
"Vertical Paging FlowLayout.xctemplate"
"Horizontal Paging FlowLayout.xctemplate")
tvos_file_template_array=(
"View Controller.xctemplate"
"View.xctemplate"
"Collection ViewController.xctemplate"
"CollectionView Cell.xctemplate"
"Video ViewController.xctemplate"
"Service.xctemplate"
"Networked Service.xctemplate"
"Network Service.xctemplate"
"Transitioning Container VC.xctemplate"
"Transitioning Context.xctemplate"
"Transitioning Animator.xctemplate")
code_snippet_array=(
"xlabel.codesnippet"
"xbutton.codesnippet"
"ximageview.codesnippet"
"xview.codesnippet"
"xattributedstring.codesnippet")
echo ""
echo "INSTALLING iOS Project Templates: "
for project_template in ${project_template_array[@]}
do
rm -f -r "$PROJECT_TEMPLATE_DIR_iOS/$project_template"
if cp -R "$PROJECT_TEMPLATE_SOURCE_DIR_iOS/$project_template" "$PROJECT_TEMPLATE_DIR_iOS/$project_template"
then echo " - $project_template Template Installed"
else echo " - $project_template Installation Failed"
fi
done
echo ""
echo "INSTALLING tvOS Project Templates: "
for project_template in ${project_template_array[@]}
do
rm -f -r "$PROJECT_TEMPLATE_DIR_tvOS/$project_template"
if cp -R "$PROJECT_TEMPLATE_SOURCE_DIR_tvOS/$project_template" "$PROJECT_TEMPLATE_DIR_tvOS/$project_template"
then echo " - $project_template Template Installed"
else echo " - $project_template Installation Failed"
fi
done
echo ""
echo "INSTALLING iOS File Templates: "
for file_template in "${ios_file_template_array[@]}"
do
if [ -d "$IOS_FILE_TEMPLATE_DIR/XCode-DI" ]
then
rm -f -r "$IOS_FILE_TEMPLATE_DIR/XCode-DI/$file_template"
else
mkdir "$IOS_FILE_TEMPLATE_DIR/XCode-DI"
fi
if cp -R "$IOS_FILE_TEMPLATE_SOURCE_DIR/$file_template" "$IOS_FILE_TEMPLATE_DIR/XCode-DI/$file_template"
then echo " - $file_template Template Installed"
else echo " - $file_template Installation Failed"
fi
done
echo ""
echo "INSTALLING TVOS File Templates: "
for file_template in "${tvos_file_template_array[@]}"
do
if [ -d "$TVOS_FILE_TEMPLATE_DIR/XCode-DI" ]
then
rm -f -r "$TVOS_FILE_TEMPLATE_DIR/XCode-DI/$file_template"
else
mkdir "$TVOS_FILE_TEMPLATE_DIR/XCode-DI"
fi
if cp -R "$TVOS_FILE_TEMPLATE_SOURCE_DIR/$file_template" "$TVOS_FILE_TEMPLATE_DIR/XCode-DI/$file_template"
then echo " - $file_template Template Installed"
else echo " - $file_template Installation Failed"
fi
done
echo ""
echo "INSTALLING Xcode Snippets: "
for code_template in "${code_snippet_array[@]}"
do
rm -f "$XCODE_SNIPPETS_TARGET_DIR/$code_template"
if cp "$XCODE_SNIPPETS_SOURCE_DIR/$code_template" "$XCODE_SNIPPETS_TARGET_DIR/$code_template"
then echo " - $code_template Snippet Installed"
else echo " - $code_template Snippet Failed"
fi
done
echo ""