Created
November 22, 2014 07:33
-
-
Save ugexe/bdc0ce756bb7d0d005c2 to your computer and use it in GitHub Desktop.
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
# current behavior: no exit code | |
multi MAIN ('install', *@modules, Bool :$notests, Bool :$nodeps) { | |
for @modules -> $x { | |
try { | |
$panda.resolve($x, :$notests, :$nodeps, :action<install>); | |
CATCH { when X::Panda { say $_.message } } | |
}; | |
} | |
} | |
# exits non-zero on failure without finishing iterating @modules | |
multi MAIN ('install', *@modules, Bool :$notests, Bool :$nodeps) { | |
my $failures; | |
for @modules -> $x { | |
try { | |
$panda.resolve($x, :$notests, :$nodeps, :action<install>); | |
CATCH { when X::Panda { $failures++ && say $_.message } } | |
}; | |
} | |
exit $failures; | |
} | |
# exits non-zero on failure after finishing iterating @modules | |
multi MAIN ('install', *@modules, Bool :$notests, Bool :$nodeps) { | |
my @failed; | |
for @modules -> $x { | |
try { | |
$panda.resolve($x, :$notests, :$nodeps, :action<install>); | |
CATCH { when X::Panda { @failed.push($_) && say $_.message } } | |
}; | |
} | |
exit @failed.elems; # or summary report on array of exceptions? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment