-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbrew.sh
More file actions
43 lines (37 loc) · 912 Bytes
/
Copy pathbrew.sh
File metadata and controls
43 lines (37 loc) · 912 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
#!/bin/bash
set -euo pipefail
TERMINAL_SOFTWARE=(
fzf
zoxide
eza
fd
bat
starship
)
install_from_array() {
local -ra software=("$@")
for pkg in "${software[@]}"; do
if brew list --cask "$pkg" 2>/dev/null || brew list --formula "$pkg" 2>/dev/null; then
echo "Already installed: $pkg"
else
echo "Installing: $pkg"
if brew install "$pkg"; then
true
else
brew install --cask "$pkg"
fi
fi
done
}
if command -v brew &>/dev/null; then
echo "Homebrew already installed"
else
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
echo "Updating Homebrew..."
brew update
echo "Installing terminal software..."
install_from_array "${TERMINAL_SOFTWARE[@]}"
echo "Cleaning up..."
brew cleanup