-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·70 lines (60 loc) · 905 Bytes
/
Copy pathbootstrap
File metadata and controls
executable file
·70 lines (60 loc) · 905 Bytes
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
#!/bin/bash
DOTFILES=$HOME/.dotfiles
BSTD=$DOTFILES/bootstrap.d
source $BSTD/utils.sh
init_brew() {
# brew exist?
if [ -x "`which brew`" ]; then
log_warn 'brew already exists!'
setup_brew
else
install_brew
setup_brew
post_setup_brew
fi
}
install_brew() {
log_echo ''
log_echo 'Install homebrew'
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
}
setup_brew() {
log_echo ''
log_echo 'Run brew bundle'
brew bundle --file=$DOTFILES/Brewfile
}
post_setup_brew() {
log_echo ''
log_echo 'Run post brew bundle'
}
init() {
log_echo ''
log_echo 'Run Init'
ask_sudo_password
init_brew
}
update() {
log_echo ''
log_echo 'Run Update'
setup_brew
}
usage() {
log_error >&2 "Usage: $0 <init|update|brew>"
exit 1
}
case $1 in
init)
init
;;
update)
update
;;
brew)
setup_brew
;;
*)
usage
;;
esac
log_echo ''
log_pass "$0: Finish!!"