3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-19 10:29:30 +01:00

Properly pass date to default VM languages

This commit is contained in:
Pragmatic Software 2017-09-08 00:21:41 -07:00
parent 6fb1c3a142
commit 9608cac9cb

View File

@ -45,8 +45,7 @@ sub preprocess {
close $fh; close $fh;
print "Executing [$self->{cmdline}] without print_last_statement\n"; print "Executing [$self->{cmdline}] without print_last_statement\n";
my ($retval, $result) = $self->execute(60, $self->{cmdline}); my ($retval, $result) = $self->execute(60, "bash -c \"date -s \@$self->{date} > /dev/null; ulimit -t 5; $self->{cmdline}\"");
$self->{output} = $result; $self->{output} = $result;
$self->{error} = $retval; $self->{error} = $retval;
@ -57,7 +56,7 @@ sub preprocess {
close $fh; close $fh;
print "Executing [$self->{cmdline}] with print_last_statement\n"; print "Executing [$self->{cmdline}] with print_last_statement\n";
$self->execute(60, $self->{cmdline}); my ($retval, $result) = $self->execute(60, "bash -c \"date -s \@$self->{date} > /dev/null; ulimit -t 5; $self->{cmdline}\"");
} }
} else { } else {
open(my $fh, '>', $self->{sourcefile}) or die $!; open(my $fh, '>', $self->{sourcefile}) or die $!;
@ -65,8 +64,7 @@ sub preprocess {
close $fh; close $fh;
print "Executing [$self->{cmdline}]\n"; print "Executing [$self->{cmdline}]\n";
my ($retval, $result) = $self->execute(60, $self->{cmdline}); my ($retval, $result) = $self->execute(60, "bash -c \"date -s \@$self->{date} > /dev/null; ulimit -t 5; $self->{cmdline}\"");
$self->{output} = $result; $self->{output} = $result;
$self->{error} = $retval; $self->{error} = $retval;
} }