Created
January 26, 2018 22:39
-
-
Save scottw/edebd8ebe06c5e6e7e0db9f7c8509bea to your computer and use it in GitHub Desktop.
Script to see what casks depend on other casks (the inverse of 'brew deps')
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
my %deps = map { $_ => [] } map { chomp; $_ } `brew list`; | |
for my $cask (sort keys %deps) { | |
print STDERR "\r\e[2KInspecting cask: '$cask'"; | |
my @deps = `brew deps $cask`; | |
chomp @deps; | |
push @{$deps{$_}}, $cask for @deps; | |
} | |
print STDERR "\r\e[2K"; | |
say "\e[1;34m$_:\e[0m " . join ', ' => @{$deps{$_}} for sort keys %deps; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment