]> sipb.mit.edu Git - ikiwiki.git/blobdiff - ikiwiki.in
remove WRAPPED_OPTIONS once loaded
[ikiwiki.git] / ikiwiki.in
index 8cb8a476939a211a862cc2c185f64d783831dfdb..ddbd710568d67d61cd3aecd3c9970b298e514edf 100755 (executable)
@@ -88,10 +88,14 @@ sub getconfig () { #{{{
 
                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 {
@@ -101,6 +105,7 @@ sub getconfig () { #{{{
                if ($@) {
                        error("WRAPPED_OPTIONS: $@");
                }
+               delete $ENV{WRAPPED_OPTIONS};
                loadplugins();
                checkconfig();
        }
@@ -112,6 +117,10 @@ sub main () { #{{{
        if ($config{setup}) {
                require IkiWiki::Setup;
                IkiWiki::Setup::load($config{setup});
+               
+               loadplugins();
+               checkconfig();
+
                if (@{$config{wrappers}} && 
                    ! $config{render} && ! $config{dumpsetup} &&
                    (! $config{refresh} || $config{genwrappers})) {
@@ -124,7 +133,7 @@ sub main () { #{{{
                        foreach my $wrapper (@wrappers) {
                                %config=(%origconfig,
                                        rebuild => 0,
-                                       verbose => 0,
+                                       verbose => undef,
                                        %{$wrapper},
                                );
                                checkconfig();
@@ -144,14 +153,11 @@ sub main () { #{{{
                # ignore syslog setting from setup file
                # while doing initial setup
                $config{syslog}=0 unless $config{dumpsetup};
-               
-               loadplugins();
-               checkconfig();
        }
 
        if ($config{dumpsetup}) {
-               require IkiWiki::Setup::Standard;
-               IkiWiki::Setup::Standard::dump($config{dumpsetup});
+               require IkiWiki::Setup;
+               IkiWiki::Setup::dump($config{dumpsetup});
        }
        elsif ($config{wrapper}) {
                lockwiki();