From: Joey Hess Date: Tue, 25 Nov 2014 19:44:34 +0000 (-0400) Subject: the user might specify a directory, rather than a file, if so just put the comment... X-Git-Tag: 3.20150107~78 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/eb7baeb196703a455221751bda4b10c149b84b53 the user might specify a directory, rather than a file, if so just put the comment in the directory --- diff --git a/ikiwiki-comment.in b/ikiwiki-comment.in index ef2751eca..b0cea4a4a 100755 --- a/ikiwiki-comment.in +++ b/ikiwiki-comment.in @@ -14,7 +14,9 @@ my $pagefile=shift || usage (); my $dir=IkiWiki::dirname($pagefile); $dir="." unless length $dir; my $page=IkiWiki::basename($pagefile); -$page=~s/\.[^.]+$//; +if (! -d $pagefile) { + $page=~s/\.[^.]+$//; +} IkiWiki::Plugin::comments::checkconfig(); my $comment_num=1 + IkiWiki::Plugin::comments::num_comments($page, $dir);