-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·48 lines (43 loc) · 1.06 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
#!/bin/bash
cd "$(dirname "${BASH_SOURCE}")"
git pull origin master
function installDotfiles() {
# Install using rsync archive mode. Recursively copies the contents of this repo into $HOME
# without removing files from the destination which aren't in the source.
rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" --exclude "README.md" -av . ~
source ~/.bash_profile
}
function setupHomebrew() {
echo
read -p "Do you want to update and upgrade Homebrew packages? " -n 1
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
~/scripts/homebrew_setup.sh
fi
}
function setupNodeJS() {
echo
read -p "Do you want to run the global Node.js setup? " -n 1
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
~/scripts/nodejs_setup.sh
fi
}
function doIt() {
installDotfiles
setupHomebrew
setupNodeJS
}
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
unset setupNodeJS
unset setupHomebrew
unset installDotfiles