shortcut tried to use srcdir in checkconfig; change it to not so this will
work.
use IkiWiki 2.00;
sub import { #{{{
- hook(type => "checkconfig", id => "shortcut", call => \&checkconfig);
+ hook(type => "refresh", id => "shortcut", call => \&refresh);
hook(type => "preprocess", id => "shortcut", call => \&preprocess_shortcut);
} #}}}
-sub checkconfig () { #{{{
+sub refresh () { #{{{
# Preprocess the shortcuts page to get all the available shortcuts
# defined before other pages are rendered.
my $srcfile=srcfile("shortcuts.mdwn", 1);
if (! $config{setup} && ! $config{render}) {
loadplugins();
- usage() unless @ARGV == 2;
- $config{srcdir} = possibly_foolish_untaint(shift @ARGV);
- $config{destdir} = possibly_foolish_untaint(shift @ARGV);
- checkconfig();
+ if (@ARGV == 2) {
+ $config{srcdir} = possibly_foolish_untaint(shift @ARGV);
+ $config{destdir} = possibly_foolish_untaint(shift @ARGV);
+ checkconfig();
+ }
+ else {
+ usage() unless $config{dumpsetup};
+ }
}
}
else {