Skip to content

Instantly share code, notes, and snippets.

@KuangyeChen
Last active July 3, 2022 00:56
Show Gist options
  • Save KuangyeChen/9d39ee90d0d77a3f15d98fcdbe062352 to your computer and use it in GitHub Desktop.
Save KuangyeChen/9d39ee90d0d77a3f15d98fcdbe062352 to your computer and use it in GitHub Desktop.
Install all brew formulae and casks
#!/usr/bin/env bash
set -e
function log_section() {
printf "\033[0;32m==>\033[0m\033[1m ${*}\033[0m\n"
}
function log_warning() {
printf "\033[1mWARN\033[0m: ${*}\n"
}
function log_error() {
printf "\033[1mERROR\033[0m: ${*}\n"
}
if [[ ! ${OSTYPE} == darwin* ]]; then
log_error "This script should only run on macos."
exit 1
fi
# Install Homebrew if not brew command not in PATH
if [[ ! $(command -v brew) ]]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
log_section "Brew Install"
BREW_INSTALLS=(
node
pipx
poetry
wget
git
chezmoi
pyenv-virtualenv
pyenv
htop
screenfetch
tmux
unrar
vim
readline
sqlite
git-crypt
typescript
cmake
yarn
)
BREW_CASK_INSTALLS=(
iterm2
google-chrome
macvim
font-ubuntu-mono-derivative-powerline
logitech-options
clashx
istat-menus
pdf-expert
raycast
sound-control
visual-studio-code
bartender
balenaetcher
telegram-desktop
zotero
xquartz
vlc
termius
notion
moom
docker
cheatsheet
appcleaner
alt-tab
discord
)
for FORMULA in "${BREW_INSTALLS[@]}"; do
brew install $FORMULA
done
# Vim Macvim conflicts, use vim on shell, macvim as gvim
brew unlink vim
for FORMULA in "${BREW_CASK_INSTALLS[@]}"; do
brew install --cask $FORMULA
done
brew link --overwrite vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment