From eb7baeb196703a455221751bda4b10c149b84b53 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 25 Nov 2014 15:44:34 -0400 Subject: the user might specify a directory, rather than a file, if so just put the comment in the directory --- ikiwiki-comment.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ikiwiki-comment.in') 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); -- cgit v1.2.3