-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·137 lines (122 loc) · 2.49 KB
/
install.sh
File metadata and controls
executable file
·137 lines (122 loc) · 2.49 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
source 'helpers.sh'
echo ""
echo_header "Starting installation"
# Ask for the admin password upfront, and run a keep-alive to
# update the `sudo` timestamp until the script has finished.
sudo -v
while true; do
sudo -n true
sleep 60
kill -0 "$$" || exit
done 2>/dev/null &
# Check for Homebrew. Install if needed.
if test ! $(which brew); then
echo_item "Installing homebrew" "green"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >>/Users/$USER/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
echo_item "Tapping additional homebrew repositories" "green"
brew tap FelixKratz/formulae
echo_item "Updating homebrew" "green"
brew update
brew upgrade
# These are the packages we want to have installed
WANTED_PACKAGES=(
borders
btop
ccache
clang-format
coreutils
direnv
dive
dockutil
efm-langserver
flyctl
font-hack-nerd-font
fzf
git-crypt
git-lfs
gnupg
go
goland
golang-migrate
goreleaser
hey
hugo
jq
lazygit
llvm
lua
ncdu
neovim
nowplaying-cli
orlangure/tap/gocovsh
pnpm
postgresql
protobuf
raycast
redis
ripgrep
rust
sf-symbols
sketchybar
spotify
starship
stow
switchaudio-osx
tfenv
tig
tldr
tmux
tree
volta
websocat
wget
zsh-autosuggestions
zsh-syntax-highlighting
)
# These are the currently installed packages
INSTALLED_PACKAGES=$(brew leaves)
# Extract the packages that we are missing
for index in "${!WANTED_PACKAGES[@]}"; do
if [[ "${INSTALLED_PACKAGES[*]}" =~ "${WANTED_PACKAGES[$index]}" ]]; then
unset -v WANTED_PACKAGES[$index]
fi
done
# These are the casks we want to have installed
WANTED_CASKS=(
cmake
discord
docker
figma
firefox
google-chrome
monodraw
nikitabobko/tap/aerospace
obsidian
redisinsight
)
# These are the currently installed casks
INSTALLED_CASKS=$(brew list --cask)
# Extract the casks that we are missing
for index in "${!WANTED_CASKS[@]}"; do
if [[ "${INSTALLED_CASKS[*]}" =~ "${WANTED_CASKS[$index]}" ]]; then
unset -v WANTED_CASKS[$index]
fi
done
if [ ${#WANTED_PACKAGES[@]} -eq 0 ]; then
echo_item "All packages are already installed" "green"
else
echo_item "Installing package: ${WANTED_PACKAGES[@]}" "green"
brew install ${WANTED_PACKAGES[@]}
fi
if [ ${#WANTED_CASKS[@]} -eq 0 ]; then
echo_item "All casks are already installed" "green"
else
echo_item "Installing cask: ${WANTED_CASKS[@]}" "green"
brew install ${WANTED_CASKS[@]} --cask
fi
echo_item "Performing homebrew cleanup" "green"
brew cleanup