From 43e46e947e0fda3e768302354e29d004da4a061b Mon Sep 17 00:00:00 2001
From: "jrayhawk+piny.be@omgwallhack.org" <jrayhawk+piny.be@omgwallhack.org>
Date: Wed, 20 Apr 2011 22:37:34 -0700
Subject: Fix rebuildrepo to work with existing Ikiwiki directories.

---
 libpiny/lib/Piny/Repo.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'libpiny/lib')

diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm
index 7818463..cfa73bd 100644
--- a/libpiny/lib/Piny/Repo.pm
+++ b/libpiny/lib/Piny/Repo.pm
@@ -237,7 +237,9 @@ sub rebuild {
   print SETUP $s->ikiwiki_setup;
   close( SETUP ) or die "Could not close new ikiwiki setup file: $!";
 
-  system( "/usr/bin/git", "clone", "--quiet", $s->path, $s->ikiwiki_srcdir ) and die "Could not clone repo to ikiwiki srcdir!"; 
+  unless( -d $s->ikiwiki_srcdir ) {
+    system( "/usr/bin/git", "clone", "--quiet", $s->path, $s->ikiwiki_srcdir ) and die "Could not clone repo to ikiwiki srcdir!"; 
+  };
 
   foreach( $ikiuser->name, $s->ikiwiki_srcdir, $s->ikiwiki_destdir, $s->secure_path ) {
     unless( -d $_ ) { mkdir( $_ ) };
-- 
cgit v1.2.3