-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·45 lines (39 loc) · 1.14 KB
/
install.sh
File metadata and controls
executable file
·45 lines (39 loc) · 1.14 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
#!/bin/bash
# Paths for Templates and Snippets folders
TEMPLATES_PATH="Templates/"
SNIPPETS_PATH="Snippets/"
# Paths for target directories
TEMPLATES_TARGET="/Users/$(whoami)/Library/Developer/Xcode/Templates/Salaourn"
SNIPPETS_TARGET="/Users/$(whoami)/Library/Developer/Xcode/UserData/CodeSnippets"
# Function for copying templates
copy_templates() {
mkdir -pv $TEMPLATES_TARGET
echo "Copying templates..."
cp -R $TEMPLATES_PATH $TEMPLATES_TARGET
echo "Template files stored in:"
echo $TEMPLATES_TARGET
}
# Function for copying snippets
copy_snippets() {
mkdir -pv $SNIPPETS_TARGET
echo "Copying snippets..."
cp -R $SNIPPETS_PATH $SNIPPETS_TARGET
echo "Snippets stored in:"
echo $SNIPPETS_TARGET
}
# Checking command line arguments
if [[ "$#" -eq 0 ]]; then
copy_templates
copy_snippets
else
while getopts "ts" option; do
case "${option}" in
t) copy_templates ;;
s) copy_snippets ;;
*) echo "Invalid option: -${OPTARG}" >&2
exit 1 ;;
esac
done
fi
echo "Operation completed successfully."
echo "Remember to quit Xcode if it's already running."