-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·177 lines (150 loc) · 3.76 KB
/
install
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#!/usr/bin/env bash
# Welcome to the team 🙌
#
# To help you getting started we have prepared an automated seup script for your computer.
# Please run the following command to install and configure all necessary softwares and tools.
#
# curl -o- https://raw.githubusercontent.com/soramitsukhmer/setup/main/install | sh
#
taps=(
'homebrew/cask-fonts'
'pp-spaces/khmer-unicode'
'soramitsukhmer/tap'
)
formulae=(
'gh'
'git'
'htop'
'jq'
'tree'
'watch'
'openfortivpn'
'soramitsukhmer/tap/lockrun'
'soramitsukhmer/tap/sshpass'
)
casks=(
'firefox'
'google-chrome'
'visual-studio-code'
'fork'
'iterm2'
'khmer-unicode-layout'
'font-khmeros-bundle'
'font-fira-code'
)
# ==================================================
# DO NOT MODIFY ANYTHING BELOW
# ==================================================
if [[ -t 1 ]]; then
tty_escape() { printf "\033[%sm" "$1"; }
else
tty_escape() { :; }
fi
tty_mkbold() { tty_escape "1;$1"; }
tty_underline="$(tty_escape "4;39")"
tty_blue="$(tty_mkbold 34)"
tty_red="$(tty_mkbold 31)"
tty_yellow="$(tty_mkbold 33)"
tty_bold="$(tty_mkbold 39)"
tty_reset="$(tty_escape 0)"
shell_join() {
local arg
printf "%s" "$1"
shift
for arg in "$@"; do
printf " "
printf "%s" "${arg// /\ }"
done
}
chomp() {
printf "%s" "${1/"$'\n'"/}"
}
ohai() {
printf "${tty_blue}==>${tty_bold} %s${tty_reset}\n" "$(shell_join "$@")"
}
warn() {
printf "${tty_yellow}Warning${tty_reset}: %s\n" "$(chomp "$1")"
}
error(){
printf "${tty_red}Error${tty_reset}: %s\n" "$(chomp "$1")" >>/dev/stderr
}
abort() {
printf "%s\n" "$1"
exit 1
}
execute() {
if ! "$@"; then
abort "$(printf "Failed during: %s" "$(shell_join "$@")")"
fi
}
# ---
echo " ____ _ _ "
echo " / ___| ___ _ __ __ _ _ __ ___ (_) |_ ___ _ _ "
echo " \___ \ / _ \| '__/ _\` | '_ \` _ \| | __/ __| | | |"
echo " ___) | (_) | | | (_| | | | | | | | |_\__ \ |_| |"
echo " |____/ \___/|_| \__,_|_| |_| |_|_|\__|___/\__,_|"
echo # (optional) move to a new line
echo # (optional) move to a new line
echo "Welcome to the team 🙌"
echo "If it's your first day today, we'd just like you to know how happy we are to have you with us 😃"
echo # (optional) move to a new line
echo "To help you getting started we have prepared an automated seup script for your computer."
echo "Please accept the below question to install and configure all necessary softwares and tools."
echo # (optional) move to a new line
read -p "Do you want to continue? [y/n]: " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
#
# Check if Homebrew is installed
# If not found, install it
#
if [ ! "$(command -v brew)" ]; then
ohai "Install Homebrew"
curl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash
fi
#
# Update Brew Repository
#
execute brew update
echo # (optional) move to a new line
#
# Add Brew Tap repositories
#
echo # (optional) move to a new line
for item in "${taps[@]}"; do
ohai "Tapping ${item}..."
execute brew tap "${item}"
done
echo # (optional) move to a new line
#
# Install Formulae
#
echo "🧰 Installing CLI Applications..."
echo # (optional) move to a new line
for item in "${formulae[@]}"; do
ohai "Installing ${item} formular..."
execute brew install --verbose "${item}"
echo # (optional) move to a new line
done
echo # (optional) move to a new line
#
# Install Casks
#
echo "🖼 Installing Applications..."
echo # (optional) move to a new line
for item in "${casks[@]}"; do
ohai "Installing ${item} cask..."
execute brew install --verbose --cask "${item}"
echo # (optional) move to a new line
done
echo # (optional) move to a new line
#
# Brew Cleanup
#
execute brew cleanup
# Done
echo # (optional) move to a new line
echo "🎉 Installation successful!"