From 307b481abdff8e0e588dc5629c9fbaf52cf61ceb Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Wed, 26 Dec 2007 13:56:10 +0100 Subject: [PATCH] New template base method create(). --- Gruta.pm | 2 ++ Gruta/Template/BASE.pm | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/Gruta.pm b/Gruta.pm index 47cd4d4..e7a341e 100644 --- a/Gruta.pm +++ b/Gruta.pm @@ -338,6 +338,8 @@ sub new { $s->create(); } + $g->template->create() if $g->{template}; + # my $u = Gruta::Data::User->new( id => 'admin', password => 'admin' ); # $g->insert_user($u); } diff --git a/Gruta/Template/BASE.pm b/Gruta/Template/BASE.pm index 0744897..7a979bd 100644 --- a/Gruta/Template/BASE.pm +++ b/Gruta/Template/BASE.pm @@ -73,4 +73,13 @@ sub save_template { } +sub create { + my $self = shift; + + # create first directory + my ($p1) = (split(':', $self->{path}))[0]; + + mkdir $p1, 0755; +} + 1; -- 2.11.4.GIT