the user might specify a directory, rather than a file, if so just put the comment in the directory

master
Joey Hess 2014-11-25 15:44:34 -04:00
parent 509370d91d
commit eb7baeb196
1 changed files with 3 additions and 1 deletions

View File

@ -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);