forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·89 lines (79 loc) · 2.2 KB
/
bootstrap.sh
File metadata and controls
executable file
·89 lines (79 loc) · 2.2 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
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
#!/usr/bin/env bash
cd "$(dirname "${BASH_SOURCE}")";
git pull origin master;
function doIt() {
# Files and directories to exclude
EXC="--exclude .git/"
EXC=${EXC}" --exclude .DS_Store"
EXC=${EXC}" --exclude .osx"
EXC=${EXC}" --exclude bootstrap.sh"
EXC=${EXC}" --exclude README.md"
EXC=${EXC}" --exclude LICENSE-MIT.txt"
EXC=${EXC}" --exclude todo.md"
EXC=${EXC}" --exclude installed_by_klaseh_jawa.txt"
EXC=${EXC}" --exclude installed_by_root_jawa.txt"
EXC=${EXC}" --exclude installed_su.txt"
EXC=${EXC}" --exclude installed.txt"
EXC=${EXC}" --exclude bashrc"
EXC=${EXC}" --exclude bash_logout"
UNAME=$(uname)
if [ "$UNAME" == "Linux" ] ; then
# Linux specific things
EXC=${EXC}" --exclude .Darwin_specific"
EXC=${EXC}" --exclude brew.sh"
EXC=${EXC}" --exclude init/"
elif [ "$UNAME" == "Darwin" ] ; then
# Mac OS X specific things
EXC=${EXC}" --exclude init/"
elif [ "$UNAME" == "FreeBSD" ] ; then
# FreeBSD specific things
EXC=${EXC}" --exclude .Darwin_specific"
EXC=${EXC}" --exclude brew.sh"
EXC=${EXC}" --exclude init/"
elif [[ "$UNAME" == CYGWIN* || $UNAME = MINGW* ]] ; then
# Windows specific things, may need more test above
EXC=${EXC}" --exclude .Darwin_specific"
EXC=${EXC}" --exclude brew.sh"
EXC=${EXC}" --exclude init/"
fi
EXC=${EXC}" -avh --no-perms"
rsync ${EXC} . ~;
grep -f bashrc ~/.bashrc
ret=$?
if [ $ret -ne 0 ]; then
cat bashrc >> ~/.bashrc
fi
source ~/.bash_profile;
}
# function doIt1() {
# EXC="--exclude .git/"
# EXC=${EXC}" --exclude .DS_Store"
# EXC=${EXC}" --exclude .osx"
# EXC=${EXC}" --exclude bootstrap.sh"
# EXC=${EXC}" --exclude README.md"
# EXC=${EXC}" --exclude LICENSE-MIT.txt"
# EXC=${EXC}" --exclude todo.md"
# UNAME=$(uname)
# if [ "$UNAME" == "Linux" ] ; then
# # Linux specific things
# EXC=${EXC}" --exclude .Darwin_specific"
# EXC=${EXC}" --exclude brew.sh"
# EXC=${EXC}" --exclude init/"
# else
# EXC="apa"
# fi
#
# EXC=${EXC}" -avh --no-perms"
#
# echo ${EXC}
# }
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;