use lib '.'; # For use in nonstandard directory, munged by Makefile.
use IkiWiki;
-sub usage () { #{{{
+sub usage () {
die gettext("usage: ikiwiki [options] source dest"), "\n",
gettext(" ikiwiki --setup configfile"), "\n";
-} #}}}
+}
-sub getconfig () { #{{{
+sub getconfig () {
if (! exists $ENV{WRAPPED_OPTIONS}) {
%config=defaultconfig();
eval q{use Getopt::Long};
loadplugins();
checkconfig();
}
-} #}}}
+}
-sub main () { #{{{
+sub main () {
getconfig();
if ($config{setup}) {
if (@{$config{wrappers}} &&
! $config{render} && ! $config{dumpsetup} &&
- (! $config{refresh} || $config{genwrappers})) {
+ ((! $config{refresh} && ! $config{post_commit})
+ || $config{genwrappers})) {
debug(gettext("generating wrappers.."));
require IkiWiki::Wrapper;
my %origconfig=(%config);
}
# setup implies a wiki rebuild by default
- if (! $config{refresh} && ! $config{render}) {
+ if (! $config{refresh} && ! $config{render} &&
+ ! $config{post_commit}) {
$config{rebuild}=1;
}
}
if ($config{dumpsetup}) {
- $config{srdir}=$config{destdir}="";
+ $config{srcdir}="" if ! defined $config{srcdir};
+ $config{destdir}="" if ! defined $config{destdir};
$config{syslog}=1 if $config{setupsyslog};
require IkiWiki::Setup;
IkiWiki::Setup::dump($config{dumpsetup});
saveindex();
debug(gettext("done"));
}
-} #}}}
+}
main;