Created
March 15, 2021 17:03
-
-
Save DaneWeber/c8b4220e656e2bbfb21e9f038331ad0e to your computer and use it in GitHub Desktop.
Gentle idempotent Mac dev setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tap "homebrew/bundle" | |
tap "homebrew/cask" | |
tap "homebrew/core" | |
cask "docker" | |
cask "iterm2" | |
cask "visual-studio-code" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
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
.