diff --git a/flake.nix b/flake.nix index 3e382d9f..3b69d0bb 100644 --- a/flake.nix +++ b/flake.nix @@ -474,6 +474,7 @@ git IOCompress IPCRun + IPCRun3 JSON JSONMaybeXS JSONXS diff --git a/src/lib/Hydra/Plugin/RunCommand.pm b/src/lib/Hydra/Plugin/RunCommand.pm index eea4d2e1..d1ce8f55 100644 --- a/src/lib/Hydra/Plugin/RunCommand.pm +++ b/src/lib/Hydra/Plugin/RunCommand.pm @@ -10,7 +10,7 @@ use Hydra::Model::DB; use Hydra::Helper::Nix; use File::Basename qw(dirname); use File::Path qw(make_path); -use IPC::Run; +use IPC::Run3; sub isEnabled { my ($self) = @_; @@ -178,9 +178,7 @@ sub buildFinished { open(my $f, '>', $logPath); umask($oldUmask); - my $stdin = ""; - my @cmd = ["sh", "-c", $command]; - IPC::Run::run(@cmd, \$stdin, $f, '2>&1') == 1 + run3($command, \undef, $f, $f, { return_if_system_error => 1 }) == 1 or warn "notification command '$command' failed with exit status $? ($!)\n"; close($f);