From: Marius Gavrilescu Date: Thu, 30 Jan 2014 16:26:43 +0000 (+0200) Subject: Add contest support to gensrc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=2d202d9c984ef03733d57b7d6b669e28fb42845c;p=gruntmaster-page.git Add contest support to gensrc --- diff --git a/lib/Gruntmaster/Page.pm b/lib/Gruntmaster/Page.pm index 6b081a2..e57b040 100644 --- a/lib/Gruntmaster/Page.pm +++ b/lib/Gruntmaster/Page.pm @@ -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;