From 5674e7fc1273800554c23ad6194e8a06dee851ae Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 7 Apr 2012 17:52:29 +0100 Subject: prune: do not prune beyond an optional base directory, and add a test Previously, prune("wiki/srcdir/sandbox/test.mdwn") could delete srcdir or even wiki, if they happened to be empty. This is rarely what you want: there's usually some base directory (destdir, srcdir, transientdir or another subdirectory of wikistatedir) beyond which you do not want to delete. --- IkiWiki/Plugin/transient.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'IkiWiki/Plugin/transient.pm') diff --git a/IkiWiki/Plugin/transient.pm b/IkiWiki/Plugin/transient.pm index 4ea4317d4..d4eb005ea 100644 --- a/IkiWiki/Plugin/transient.pm +++ b/IkiWiki/Plugin/transient.pm @@ -43,7 +43,7 @@ sub rendered (@) { my $casualty = "$transientdir/$file"; if (srcfile($file) ne $casualty && -e $casualty) { debug(sprintf(gettext("removing transient version of %s"), $file)); - IkiWiki::prune($casualty); + IkiWiki::prune($casualty, $transientdir); } } } -- cgit v1.2.3