-
Notifications
You must be signed in to change notification settings - Fork 0
/
brew_install.zsh
executable file
·79 lines (66 loc) · 1.44 KB
/
brew_install.zsh
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
#!/bin/zsh -eux
export HOMEBREW_NO_AUTO_UPDATE=1
# command install
formulas=(
fzf
sheldon
git
nodebrew
yarn
gengig
tsc
)
# GUI application install
casks=(
docker
github
google-chrome
microsoft-teams
slack
sourcetree
visual-studio-code
zoom
)
# Install Homebrew if not installed
if ! command -v brew >/dev/null 2>&1; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Run brew doctor
if command -v brew >/dev/null 2>&1; then
brew doctor
fi
# Run brew update
if command -v brew >/dev/null 2>&1; then
brew update
fi
# Run brew upgrade
if command -v brew >/dev/null 2>&1; then
brew upgrade
fi
brew update
brew tap homebrew/cask-fonts
brew tap ktr0731/evans
brew tap jesseduffield/lazydocker
# Install formulas
for formula in "${formulas[@]}"; do
brew install "$formula"
done
# Initialize starship if installed
if command -v starship >/dev/null 2>&1; then
eval "$(starship init zsh)"
fi
case "${OSTYPE}" in
darwin*)
for cask in "${casks[@]}"; do
brew install --cask "$cask"
done
GCC_VER=$(ls $(brew --prefix)/bin | grep -E "^g\+\+\-(\d+) \->" | awk '{print $1}' | sed -e "s/g++-//g")
sudo ln -snfv "$(brew --prefix gcc)/gcc-${GCC_VER}" /usr/local/bin/gcc
sudo ln -snfv "$(brew --prefix gcc)/g++-${GCC_VER}" /usr/local/bin/g++
;;
linux*)
sudo apt update
sudo apt install -y docker.io
;;
esac
unset HOMEBREW_NO_AUTO_UPDATE