-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_applications.sh
More file actions
executable file
·121 lines (95 loc) · 3.06 KB
/
install_applications.sh
File metadata and controls
executable file
·121 lines (95 loc) · 3.06 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
cd "$(dirname "${BASH_SOURCE}")" && source "../utils.sh"
# Homebrew Formulae
# https://github.com/Homebrew/homebrew
declare -a HOMEBREW_FORMULAE=(
"bash-completion"
"caskroom/cask/brew-cask"
"git"
"imagemagick --with-webp"
"node"
"vim --override-system-vi"
"rbenv"
"ruby-build"
"heroku-toolbelt"
)
# Homebrew Casks
# https://github.com/caskroom/homebrew-cask
declare -a HOMEBREW_CASKS=(
"firefox"
"google-chrome"
"macvim"
"spectacle"
"vlc"
"google-hangouts"
"sourcetree"
"iterm2"
"postgres"
"mou"
"caffeine"
"skype"
"atom"
"screenhero"
"adobe-reader"
"flux"
)
# Homebrew Alternate Casks
# https://github.com/caskroom/homebrew-versions
declare -a HOMEBREW_ALTERNATE_CASKS=(
)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
main() {
local i="", tmp=""
# XCode Command Line Tools
if [ $(xcode-select -p &> /dev/null; printf $?) -ne 0 ]; then
xcode-select --install &> /dev/null
# Wait until the XCode Command Line Tools are installed
while [ $(xcode-select -p &> /dev/null; printf $?) -ne 0 ]; do
sleep 5
done
fi
print_success "XCode Command Line Tools\n"
# Homebrew
if [ $(cmd_exists "brew") -eq 1 ]; then
printf "\n" | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# └─ simulate the ENTER keypress
print_result $? "brew"
fi
if [ $(cmd_exists "brew") -eq 0 ]; then
execute "brew update" "brew (update)"
execute "brew upgrade" "brew (upgrade)"
execute "brew cleanup" "brew (cleanup)"
# Homebrew formulae
for i in ${!HOMEBREW_FORMULAE[*]}; do
tmp="${HOMEBREW_FORMULAE[$i]}"
print_installing "$tmp"
[ $(brew list "$tmp" &> /dev/null; printf $?) -eq 0 ] \
&& print_success "$tmp" \
|| execute "brew install $tmp" "$tmp"
done
printf "\n"
# Homebrew casks
if [ $(brew list brew-cask &> /dev/null; printf $?) -eq 0 ]; then
for i in ${!HOMEBREW_CASKS[*]}; do
tmp="${HOMEBREW_CASKS[$i]}"
print_installing "$tmp"
[ $(brew cask list "$tmp" &> /dev/null; printf $?) -eq 0 ] \
&& print_success "$tmp" \
|| execute "brew cask install $tmp" "$tmp"
done
printf "\n"
# Homebrew alternate casks
brew tap caskroom/versions &> /dev/null
if [ $(brew tap | grep "caskroom/versions" &> /dev/null; printf $?) -eq 0 ]; then
for i in ${!HOMEBREW_ALTERNATE_CASKS[*]}; do
tmp="${HOMEBREW_ALTERNATE_CASKS[$i]}"
print_installing "$tmp"
[ $(brew cask list "$tmp" &> /dev/null; printf $?) -eq 0 ] \
&& print_success "$tmp" \
|| execute "brew cask install $tmp" "$tmp"
done
fi
fi
fi
}
main