add new wiki to wikilist
[ikiwiki.git] / ikiwiki.in
index febc8ff56ed42ee876b85db2b235270961737963..d8e848f8727c5dbfd11bc0f9ce976e0821b68cff 100755 (executable)
@@ -88,10 +88,14 @@ sub getconfig () { #{{{
 
                if (! $config{setup} && ! $config{render}) {
                        loadplugins();
 
                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 {
                }
        }
        else {
@@ -112,6 +116,10 @@ sub main () { #{{{
        if ($config{setup}) {
                require IkiWiki::Setup;
                IkiWiki::Setup::load($config{setup});
        if ($config{setup}) {
                require IkiWiki::Setup;
                IkiWiki::Setup::load($config{setup});
+               
+               loadplugins();
+               checkconfig();
+
                if (@{$config{wrappers}} && 
                    ! $config{render} && ! $config{dumpsetup} &&
                    (! $config{refresh} || $config{genwrappers})) {
                if (@{$config{wrappers}} && 
                    ! $config{render} && ! $config{dumpsetup} &&
                    (! $config{refresh} || $config{genwrappers})) {
@@ -144,9 +152,6 @@ sub main () { #{{{
                # ignore syslog setting from setup file
                # while doing initial setup
                $config{syslog}=0 unless $config{dumpsetup};
                # ignore syslog setting from setup file
                # while doing initial setup
                $config{syslog}=0 unless $config{dumpsetup};
-               
-               loadplugins();
-               checkconfig();
        }
 
        if ($config{dumpsetup}) {
        }
 
        if ($config{dumpsetup}) {