From 2d202d9c984ef03733d57b7d6b669e28fb42845c Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 30 Jan 2014 18:26:43 +0200 Subject: [PATCH] Add contest support to gensrc --- lib/Gruntmaster/Page.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.39.2