Skip to content

Instantly share code, notes, and snippets.

@colinrymer
Last active December 14, 2015 18:39
Show Gist options
  • Save colinrymer/5131225 to your computer and use it in GitHub Desktop.
Save colinrymer/5131225 to your computer and use it in GitHub Desktop.
Get a list of installed homebrew formula with any options used to install them.
#!/usr/bin/env ruby
#
# Colin Rymer - 2013-03-10
require 'json'
Dir.glob('/usr/local/Cellar/**/INSTALL_RECEIPT.json').each do |brew|
name = brew.split('/')[4]
receipt = JSON.load(File.open(brew))
options = receipt['used_options'].join(' ')
puts "#{name} #{options unless options.empty?}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment