-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbootstrap.sh
executable file
·55 lines (48 loc) · 1.44 KB
/
bootstrap.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
#!/usr/bin/env bash
cd "$(dirname "${BASH_SOURCE}")";
#git pull origin master;
function doIt() {
rsync --exclude ".git/" \
--exclude ".DS_Store" \
--exclude "jumper.expect" \
--exclude "config" \
--exclude "bootstrap.sh" \
--exclude "vim.sh" \
--exclude "emacs.sh" \
--exclude "README.md" \
--exclude "LICENSE-MIT.txt" \
--exclude ".vimrc" \
--exclude ".vim" \
--exclude ".emacs.d" \
--exclude "brew.sh" \
--exclude "apt.sh" \
--exclude "rime-settings" \
--exclude "squirrel" \
--exclude ".macos" \
--exclude "mac_plist" \
-avh --no-perms . ~;
source ~/.bash_profile;
}
if [ "$1" == "--force" -o "$1" == "-f" ]; then
doIt;
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt;
fi;
fi;
unset doIt;
sysType=`uname -s`
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo -e "\033[40;32m start to install command line tools for your system ${sysType} \033[0m"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
if [ $sysType = "Linux" ]; then
source ./apt.sh;
elif [ $sysType = "Darwin" ]; then
source ./brew.sh;
else
echo -e "\033[40;32m unsupported system, exit \033[0m"
fi
echo -e "\033[40;32m All done, HAPPY HACKING :-) \033[0m"
echo ""