use Moo::Role;
use IO::All;
+use Capture::Tiny qw(capture_merged);
use IPC::System::Simple qw(run capture);
has list_dir => (is => 'ro', required => 1);
sub _call_command {
my ($self, @cmd) = @_;
- run $self->_command_args(@cmd);
+ my $ok;
+ my $out = capture_merged {
+ $ok = eval { run $self->_command_args(@cmd); 1 };
+ };
+ die "Command failed: $out\n" unless $ok;
+ return;
}
sub _capture_command {