RunCommand: use IPC::Run3::run3 instead

run3 just seems to do better handling for what we want to do, and
requires less deep-reaching changes to this plugin to get it to play
nice, as IPC::Run::run would.
This commit is contained in:
Cole Helbling 2022-01-25 12:09:05 -08:00
parent 3e722f1d0a
commit fdf6f4d3da
2 changed files with 3 additions and 4 deletions

View file

@ -474,6 +474,7 @@
git git
IOCompress IOCompress
IPCRun IPCRun
IPCRun3
JSON JSON
JSONMaybeXS JSONMaybeXS
JSONXS JSONXS

View file

@ -10,7 +10,7 @@ use Hydra::Model::DB;
use Hydra::Helper::Nix; use Hydra::Helper::Nix;
use File::Basename qw(dirname); use File::Basename qw(dirname);
use File::Path qw(make_path); use File::Path qw(make_path);
use IPC::Run; use IPC::Run3;
sub isEnabled { sub isEnabled {
my ($self) = @_; my ($self) = @_;
@ -178,9 +178,7 @@ sub buildFinished {
open(my $f, '>', $logPath); open(my $f, '>', $logPath);
umask($oldUmask); umask($oldUmask);
my $stdin = ""; run3($command, \undef, $f, $f, { return_if_system_error => 1 }) == 1
my @cmd = ["sh", "-c", $command];
IPC::Run::run(@cmd, \$stdin, $f, '2>&1') == 1
or warn "notification command '$command' failed with exit status $? ($!)\n"; or warn "notification command '$command' failed with exit status $? ($!)\n";
close($f); close($f);