Last active
August 20, 2018 22:59
-
-
Save bezhermoso/97b1ce74e3233f394c3c2068c7f66008 to your computer and use it in GitHub Desktop.
Create an inventory of installed Homebrew formulae, preserving flags
This file contains hidden or 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 bash | |
brew list | while read formula; do | |
command="brew install $formula" | |
flags="$(brew info $formula | grep -i "built from source .* with:" | cut -f 11- -d' ')" | |
echo $command $flags | |
done | |
# Usage: | |
# ./brew-inventory.sh >! brew-formulae.txt | |
# To install from inventory output i.e. brew-formulae.txt: | |
# eval "$(cat brew-formulae.txt)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UPDATE: Just use https://github.com/Homebrew/homebrew-bundle