-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrew.sh
executable file
·66 lines (58 loc) · 1.78 KB
/
brew.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bash
# Install Homebrew & apps
if ! command -v brew &>/dev/null; then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
source "$HOME/.zshrc"
fi
brew update
brew upgrade
apps=(
bash # System version too low
git # Git CLI
git-extras # Git aliases
gh # GitHub CLI
glab # GitLab CLI
go # golang
httpstat # http client tools
wifi-password # Get wifi password CLI
fnm # https://github.com/Schniz/fnm
rbenv # https://github.com/rbenv/rbenv
mas # https://github.com/mas-cli/mas
)
for app in "${apps[@]}"; do
if brew list "$app" &>/dev/null; then
echo "$app is already installed. Skipping..."
continue
fi
done
# refs: https://formulae.brew.sh/cask/
casks=(
font-fira-code # https://github.com/tonsky/FiraCode
raycast # https://raycast.com/
orbstack # https://orbstack.dev/
google-chrome # https://www.google.com/chrome/
visual-studio-code # https://code.visualstudio.com/
telegram # https://macos.telegram.org/
)
# Applications with special names
# raycast => Raycast.app
declare -A cask_map=(
["raycast"]="Raycast"
["orbstack"]="Orbstack"
["google-chrome"]="Google Chrome"
["visual-studio-code"]="Visual Studio Code"
["telegram"]="Telegram"
)
for cask in "${casks[@]}"; do
if brew list --cask "$cask" &>/dev/null; then
echo "$cask is already installed. Skipping..."
continue
fi
app_name="${cask_map[$cask]}"
if [ -d "/Applications/${app_name}.app" ]; then
echo "/Applications/$app_name.app is already installed. Skipping..."
continue
fi
brew install --cask "$cask"
done