use File::Slurp;
use File::Spec::Functions qw(:ALL);
+use File::Temp qw(tempfile);
use SL::System::Process;
sub _run_script_command {
my ($self, $command) = @_;
- my $exe = catfile(catdir(SL::System::Process->exe_dir, 'scripts'), 'task_server.pl');
- $self->last_command_output(`${exe} ${command}`);
+ my ($fh, $file_name) = tempfile();
+ my $exe = catfile(catdir(SL::System::Process->exe_dir, 'scripts'), 'task_server.pl');
+
+ system "${exe} ${command} >> ${file_name} 2>&1";
+
+ $fh->close;
+
+ $self->last_command_output(read_file($file_name));
return $? == 0 ? 1 : undef;
}