Created
March 14, 2017 08:32
-
-
Save deecewan/51cd2a2d40b454f1e43c461ad020458f to your computer and use it in GitHub Desktop.
Store all your brew formula and reload in case of emergency
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
# ... | |
brw() { | |
brew $@ | |
brew list --versions | perl -pe 's/([\w-(@\d\.\d)]+).*/$1/' > $CONFIG/brew_installed.txt | |
} | |
restore_from_brew() { | |
cat $CONFIG/brew_installed.txt | xargs brew install | |
} |
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
# Sets up computer | |
# have other things in here to load back in all your .*rc files | |
# here is an example using GNU Stow | |
pushd ~ | |
git clone https://github.com/deecewan/dotfiles.git | |
pushd dotfiles | |
find . -type d -maxdepth 1 | xargs stow | |
# contents of dotfiles is [brew_installed.txt, git, iterm, setup.sh, zsh] | |
# see `man stow` for more info | |
# install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
source ~/.zshrc | |
restore_from_brew | |
echo "Installed everything" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment