Gruntmaster::Page::generate should mkdir -p before generating
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 16 Jan 2014 17:27:01 +0000 (19:27 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 16 Jan 2014 17:27:01 +0000 (19:27 +0200)
lib/Gruntmaster/Page.pm

index d3d25066accaaa17ba53591b76e0755338f413a9..953d8ae4ab6d78c181d558cff9de3884762f4901 100644 (file)
@@ -8,6 +8,7 @@ our @EXPORT_OK = qw/generate _generate/;
 
 use Fcntl qw/:flock/;
 use File::Basename qw/fileparse/;
+use File::Path qw/make_path/;
 use File::Slurp qw/write_file/;
 use IO::Compress::Gzip qw/gzip/;
 use IO::File;
@@ -49,7 +50,8 @@ sub declaregen{
 sub _generate{
        my ($path) = @_;
        my ($path_noext, $ext) = $path =~ m/^(.*)\.(.*)$/;
-       my $basename = fileparse $path_noext;
+       my ($basename, $directories) = fileparse $path_noext;
+       make_path $directories;
 
        IO::File->new(">$path_noext.var")->close unless -f "$path_noext.var";
        flock my $lockfh = IO::File->new("<$path_noext.var"), LOCK_EX;
This page took 0.010866 seconds and 4 git commands to generate.