-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacos-setup.sh
More file actions
82 lines (68 loc) · 1.7 KB
/
macos-setup.sh
File metadata and controls
82 lines (68 loc) · 1.7 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
#!/bin/bash
# ------------------------------------------------------------------------------
#
# Stephen's MacOS Setup Script
#
# To use, run:
# curl https://raw.githubusercontent.com/SRF-Audio/utility-scripts/main/macos-setup.sh > macos-setup.sh && chmod +x macos-setup.sh && ./macos-setup.sh
#
# ------------------------------------------------------------------------------
if ! command -v brew &> /dev/null; then
echo "Homebrew could not be found, installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Updating Homebrew..."
brew update
fi
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
function brew_install_or_update {
if brew ls --versions "$1" >/dev/null; then
echo "$1 is already installed, checking for updates..."
brew upgrade "$1"
else
echo "Installing $1..."
brew install "$1"
fi
}
brew_formulae=(
git
jq
xclip
gcc
python
go
kubectl
helm
kustomize
skaffold
istioctl
k9s
)
brew_casks=(
1password
1password-cli
brave-browser
iterm2
visual-studio-code
moom
microsoft-teams
slack
discord
rancher
)
for formula in "${brew_formulae[@]}"; do
brew_install_or_update "$formula"
done
for cask in "${brew_casks[@]}"; do
brew_install_or_update "--cask $cask"
done
if ! grep -q "alias python='python3'" ~/.zshrc; then
echo "alias python='python3'" >> ~/.zshrc
fi
python3 -m ensurepip --upgrade
if ! grep -q "alias pip='pip3'" ~/.zshrc; then
echo "alias pip='pip3'" >> ~/.zshrc
fi
source ~/.zshrc
echo "Setup completed!"