-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·55 lines (42 loc) · 1.08 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;
read -p "Do you want to run brew.sh? (y/n)" -n 1;
echo "";
# Installing brew packages
if [[ $REPLY =~ ^[Yy]$ ]]; then
source brew.sh;
fi;
# Installing .oh-my-zsh
if [ ! -d "${HOME}/.oh-my-zsh" ]; then
echo -e "Installing oh-my-zsh";
echo "";
git clone https://github.com/robbyrussell/oh-my-zsh.git ${HOME}/.oh-my-zsh
fi;
# Installing nvm
echo -e "Installing nvm";
echo "";
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
function sync() {
rsync --exclude ".git/" \
--exclude "bootstrap.sh" \
--exclude "brew.sh" \
--exclude "LICENSE" \
--exclude "README.md" \
-avh --no-perms . ~;
if [ ${SHELL} != "/bin/zsh" ]; then
chsh -s /bin/zsh;
fi;
exec zsh;
}
echo -e "\nInstall dotfiles\n";
if [ "$1" == "--force" -o "$1" == "-f" ]; then
sync;
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
sync;
fi;
fi;
unset sync;