Created
April 30, 2015 15:18
-
-
Save developernotes/5fc02338257328223ceb to your computer and use it in GitHub Desktop.
List installed homebrew packages and their dependencies
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
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