Gentle idempotent Mac dev setup
#!/usr/bin/env zsh | |
brew_major_version=$(brew --version | head -c 10) | |
if [ "$brew_major_version" = 'Homebrew 3' ]; then | |
echo 'Homebrew already installed' | |
echo 'Updating Homebrew' | |
brew update | |
else | |
echo 'Installing Homebrew' | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
fi | |
echo 'Install and update packages in the Brewfile` | |
brew bundle |
#!/usr/bin/env zsh | |
export OMZ=~/.oh-my-zsh | |
if [ -d $OMZ ]; then | |
echo 'Oh My Zsh is already installed.' | |
else | |
echo 'Installing Oh My Zsh:' | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
fi | |
export PLUGINS="alias-finder brew common-aliases git" | |
if grep -qF "plugins=(git)" ~/.zshrc; then | |
sed -i '' "s/plugins=(git)/plugins=($PLUGINS)/g" ~/.zshrc | |
echo 'Oh My Zsh plugins set to baseline.' | |
source ~/.zshrc | |
else | |
echo 'Oh My Zsh plugins left alone because they are not default. Current set of plugins:' | |
grep "^plugins=" ~/.zshrc | |
fi | |
if [ ! -d $ZSH_CUSTOM/themes/powerlevel10k ]; then | |
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k | |
fi | |
echo 'Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc if you want this awesome theme.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Run
brew bundle dump
to create aBrewfile
based on your currently installed packages. You can overwrite an existingBrewfile
, such as a version-controlled one, withbrew bundle dump --force
.