diff options
Diffstat (limited to 'libpiny/lib')
-rw-r--r-- | libpiny/lib/Piny/Repo.pm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index 4f520b8..86abc45 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -212,6 +212,7 @@ sub rebuild { my ( $s ) = @_; $s->rebuild_git; + $s->destroy_ikiwiki; $s->rebuild_ikiwiki; }; @@ -310,6 +311,18 @@ sub rebuild_ikiwiki { sub destroy { my ( $s ) = @_; + $s->destroy_ikiwiki; + $s->destroy_git; +}; + +sub destroy_git { + my ( $s ) = @_; + system( "rm", "-rf", $s->path ); +}; + +sub destroy_ikiwiki { + my ( $s ) = @_; + my $user = Piny::Environment->instance->user; unlink( "/etc/apache2/piny-enabled/" . $s->name ); @@ -336,7 +349,7 @@ sub destroy { rename( $temp->filename, "/etc/ikiwiki/wikilist" ) or die "Could not rename over old wikilist: $!"; - system( "rm", "-rf", $s->secure_path, $s->ikiwiki_destdir, $s->ikiwiki_srcdir, "/etc/ikiwiki/piny/" . $s->name . ".setup", $s->path ); + system( "rm", "-rf", $s->secure_path, $s->ikiwiki_destdir, $s->ikiwiki_srcdir, "/etc/ikiwiki/piny/" . $s->name . ".setup" ); my $ikiuser = Piny::User::IkiWiki->new( "name" => "iki-" . $s->name ); |