-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·61 lines (46 loc) · 1.22 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
#!/usr/bin/env sh
set -e
cd "$(dirname "$(readlink -f "$0")")"
goto_url() {
echo "Would you like to go to $1? (y/n)"
read -r reply
if [ "$reply" = "y" ]; then
open "$1"
fi
}
find_app() {
query="kMDItemKind == 'Application' && kMDItemDisplayName == '$1'"
if [ -z "$(mdfind -onlyin /Applications "$query")" ]; then
echo "$1 not installed."
return 1
fi
return 0
}
if ! xcode-select -p >/dev/null 2>&1; then
xcode-select --install
sudo /usr/sbin/DevToolsSecurity -enable
sudo dscl . append /Groups/_developer GroupMembership "$(whoami)"
fi
if ! command -v brew >/dev/null 2>&1; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
if ! brew bundle check --no-upgrade >/dev/null 2>&1; then
brew bundle -v --no-lock --file Brewfile
fi
if ! command -v rustup >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
fi
if ! command -v go >/dev/null 2>&1; then
echo "Go not installed."
goto_url "https://go.dev"
fi
if ! command -v npm >/dev/null 2>&1; then
echo "NodeJS not installed."
goto_url "https://nodejs.org"
fi
if ! find_app "iTerm"; then
goto_url "https://iterm2.com"
fi
if ! find_app "Docker"; then
goto_url "https://docker.com"
fi