Skip to content

Instantly share code, notes, and snippets.

@developernotes
Created April 30, 2015 15:18
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 developernotes/5fc02338257328223ceb to your computer and use it in GitHub Desktop.
Save developernotes/5fc02338257328223ceb to your computer and use it in GitHub Desktop.
List installed homebrew packages and their dependencies
require 'utils'
class ListDependencies
def run
@command = <<-EOT
brew list | while read cask; do
printf "\e[1;34m%s ->\e[1;37m" "$cask";
brew deps $cask | awk '{printf(" %s ", $0)}'; echo "";
done
EOT
display("Listing installed packages and their dependencies")
safe_system(@command)
end
def display(message, &block)
if $stdout.tty? and not ARGV.flag? '--quiet'
ohai message
end
end
end
runner = ListDependencies.new
runner.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment