]> iEval git - gruntmaster-daemon.git/blobdiff - gruntmaster-compile
Move the compile and execute logic to standalone scripts
[gruntmaster-daemon.git] / gruntmaster-compile
diff --git a/gruntmaster-compile b/gruntmaster-compile
new file mode 100755 (executable)
index 0000000..0414e4f
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/perl -w
+use v5.14;
+no if $] > 5.017011, warnings => 'experimental::smartmatch';
+
+my ($format, $basename, $name) = @ARGV;
+my $ret = fork // die $!;
+if ($ret) {
+  $SIG{ALRM} = sub {kill KILL => $ret};
+  alarm 5;
+  wait;
+  exit $? >> 8
+} else {
+  given ($format){
+       exec 'g++', '-o', $basename, $name when 'CPP';
+  }
+}
This page took 0.025202 seconds and 4 git commands to generate.