Skip to content

Instantly share code, notes, and snippets.

@RSully
Created October 8, 2015 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RSully/28258330ec8eb1f2bb0b to your computer and use it in GitHub Desktop.
Save RSully/28258330ec8eb1f2bb0b to your computer and use it in GitHub Desktop.
Generate commands to reinstall homebrew packages
#!/usr/bin/env bash
brew tap | while read tap;
do
echo "brew tap $tap"
done
brew list | while read formula;
do
options=$(brew info --json=v1 $formula | jq '.[0] .installed | sort_by(.version) [0] .used_options | join(" ")' -r)
echo "brew install $formula $options"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment