X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/bab8fec52468b780485bdf96a37a593bd033c7e3..e694579d2729a8f771acc9e5789efc03e039ed56:/ikiwiki-calendar.in diff --git a/ikiwiki-calendar.in b/ikiwiki-calendar.in index 9738ea5f7..60df99855 100755 --- a/ikiwiki-calendar.in +++ b/ikiwiki-calendar.in @@ -15,7 +15,10 @@ GetOptions( "force" => \$force, ) || usage(); my $setup=shift || usage(); -my $pagespec=shift || "*"; +my $pagespec; +if (@ARGV && $ARGV[0] !~ /^\d+$/) { + $pagespec=shift; +} my $startyear=shift || 1900+(localtime(time))[5]; my $endyear=shift || $startyear; @@ -27,6 +30,10 @@ IkiWiki::checkconfig(); my $archivebase = 'archives'; $archivebase = $config{archivebase} if defined $config{archivebase}; +if (! defined $pagespec) { + $pagespec=$config{archive_pagespec} || "*"; +} + sub writearchive ($$;$) { my $template=template(shift); my $year=shift; @@ -52,7 +59,8 @@ foreach my $y ($startyear..$endyear) { } } -IkiWiki::rcs_commit_staged(gettext("calendar update"), undef, undef) +IkiWiki::rcs_commit_staged(message => gettext("calendar update")) if $config{rcs}; -system("ikiwiki", "-setup", $setup, "-refresh"); +exec("ikiwiki", "-setup", $setup, "-refresh"); +die "failed to run ikiwiki -setup $setup -refresh\n";