-
Notifications
You must be signed in to change notification settings - Fork 21
/
install.sh
executable file
·50 lines (33 loc) · 1.13 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
#!/bin/bash
BEEFRAMEWORK="BeeFramework"
TEMPLATE_PATH="$HOME/Library/Developer/Xcode/Templates"
SOURCE_TEMPLATE="./Templates"
echo "
______ ______ ______
/\\ __ \\ /\\ ___\\ /\\ ___\\
\\ \\ __< \\ \\ __\\_ \\ \\ __\\_
\\ \\_____\\ \\ \\_____\\ \\ \\_____\\
\\/_____/ \\/_____/ \\/_____/
Copyright (c) 2013-2014, {Bee} open source community
\\033[4mhttp://www.bee-framework.com\\033[0m
Xcode Template For BeeFramework BY QFish
\\033[4mhttp://QFi.sh\\033[0m
=======================================================
"
if [[ ! -d "$TEMPLATE_PATH" ]]; then
sudo mkdir -p "$TEMPLATE_PATH"
echo "[mkdir] $TEMPLATE_PATH"
fi
# 如果已有,先删除上一个版本的
sudo find "$TEMPLATE_PATH" -type d -name "*$BEEFRAMEWORK*" > ".deleles"
while read line; do
echo "[Removed] $line"
sudo rm -rf "$line";
done < ".deleles"
sudo rm -rf ".deleles"
# 复制
sudo cp -rf "$SOURCE_TEMPLATE" "$TEMPLATE_PATH/.."
# cleanup
sudo find "$TEMPLATE_PATH" -name ".beeframework.gitignore" -depth -exec rm {} \;
echo "[Installed] $TEMPLATE_PATH."
echo "\n\\033[31mBee Xcode Template has been installed.\\033[0m\n"