X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage.pm;h=953d8ae4ab6d78c181d558cff9de3884762f4901;hb=ea6ce64dda40ffaa82846103d02a9c7668bd2a44;hp=d3d25066accaaa17ba53591b76e0755338f413a9;hpb=83a8a7d6035372ef9d8e78fb46742f7bf2a3a1ca;p=gruntmaster-page.git diff --git a/lib/Gruntmaster/Page.pm b/lib/Gruntmaster/Page.pm index d3d2506..953d8ae 100644 --- a/lib/Gruntmaster/Page.pm +++ b/lib/Gruntmaster/Page.pm @@ -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;