]> iEval git - gruntmaster-page.git/commitdiff
Add contest support to gensrc
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 30 Jan 2014 16:26:43 +0000 (18:26 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 30 Jan 2014 16:26:43 +0000 (18:26 +0200)
lib/Gruntmaster/Page.pm

index 6b081a2702df83ce88043646ba7a9556d254b14e..e57b0402495cb9e13306bea0448a798c8458ecf1 100644 (file)
@@ -90,10 +90,13 @@ sub generate{
 }
 
 sub gensrc{
-       my ($job) = @_;
+       my ($contest, $job) = split /\./, $_[0];
+       local $Gruntmaster::Data::contest = $contest if $contest;
        my $ext = job_extension $job;
-       make_path "log/src/";
-       write_file "log/src/$job.$ext", job_inmeta($job)->{files}{prog}{content};
+       my $log = $contest ? "ct/$contest/log" : 'log';
+       make_path "$log/src/";
+       say STDERR "Writing to $log/src/$job.$ext";
+       write_file "$log/src/$job.$ext", job_inmeta($job)->{files}{prog}{content};
 }
 
 1;
This page took 0.029383 seconds and 4 git commands to generate.