forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·59 lines (53 loc) · 1.72 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
56
57
58
59
#!/usr/bin/env bash
if [[ "$OSTYPE" == "linux-gnu" ]]; then
echo '' &>/dev/null;
elif [[ "$OSTYPE" == "darwin"* ]]; then
SUBL="/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl";
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo '' &>/dev/null;
elif [[ "$OSTYPE" == "win32" ]]; then
echo '' &>/dev/null;
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo '' &>/dev/null;
else
echo '' &>/dev/null;
fi;
cd "$(dirname "${BASH_SOURCE}")";
git pull origin master;
function doItCygwin() {
rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" \
--exclude "README.md" --exclude "LICENSE-MIT.txt" \
--exclude ".osx" --exclude "Brewfile" --exclude "Caskfile" --exclude "init/" \
-avh --no-perms . ~;
echo "ca_directory = /usr/ssl/certs # Cygwin CA Certs directory is non standard" >> ~/.wgetrc;
}
function doItMac() {
rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" \
--exclude "README.md" --exclude "LICENSE-MIT.txt" \
--exclude ".minttyrc" -avh --no-perms . ~;
}
function doIt() {
# OS specific
if [[ "$OSTYPE" == "darwin"* ]]; then
doItMac;
elif [[ "$OSTYPE" == "cygwin" ]]; then
doItCygwin;
else
rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" \
--exclude "README.md" --exclude "LICENSE-MIT.txt" \
--exclude ".osx" --exclude "Brewfile" --exclude "Caskfile" --exclude "init/" \
-avh --no-perms . ~;
fi
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm;
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;