1 package Tak::CommandService;
3 use Capture::Tiny qw(capture);
4 use IPC::System::Simple qw(runx EXIT_ANY);
7 with 'Tak::Role::Service';
10 my ($self, $command) = @_;
12 my ($stdout, $stderr) = capture {
13 $code = runx(EXIT_ANY, @$command);
15 return { stdout => $stdout, stderr => $stderr, exit_code => $code };