forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
01-bootstrap.sh
executable file
·47 lines (39 loc) · 1.2 KB
/
01-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
#!/usr/bin/env zsh
cd "$(dirname "${BASH_SOURCE}")";
# pull the current branch
git pull origin $(git rev-parse --abbrev-ref HEAD);
MY_SHELL=$(ps -p $$ -ocomm=)
function doIt() {
rsync --exclude ".git/" \
--exclude ".DS_Store" \
--exclude ".extra" \
--exclude "01-bootstrap.sh" \
--exclude "02-brew.sh" \
--exclude "03-macos.sh" \
--exclude "04-python.sh" \
--exclude "05-python-updates.sh" \
--exclude "Brewfile" \
--exclude "Brewfile_work" \
--exclude "README.md" \
--exclude "LICENSE-MIT.txt" \
-avh --no-perms . ~;
if [[ "$MY_SHELL" =~ 'zsh' ]]; then
if [ -f ~/.zshrc ]; then
source ~/.zshrc;
fi;
elif [[ "$MY_SHELL" =~ 'bash' ]]; then
if [ -f ~/.bash_profile ]; then
source ~/.bash_profile;
fi;
fi;
}
if [[ "$MY_SHELL" =~ 'zsh' ]]; then
read -q "REPLY?This may overwrite existing files in your home directory. Are you sure? (y/n) ";
elif [[ "$MY_SHELL" =~ 'bash' ]]; then
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
fi;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt;
fi;
unset doIt;