summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/CGI.pm3
-rwxr-xr-xikiwiki51
2 files changed, 30 insertions, 24 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 3ac984d30..4a16856ec 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -271,6 +271,8 @@ sub cgi_editpage ($$) { #{{{
my $q=shift;
my $session=shift;
+ loadindex();
+
eval q{use CGI::FormBuilder};
my $form = CGI::FormBuilder->new(
fields => [qw(do rcsinfo from page content comments)],
@@ -446,7 +448,6 @@ sub cgi_editpage ($$) { #{{{
}
else {
require IkiWiki::Render;
- loadindex();
refresh();
saveindex();
}
diff --git a/ikiwiki b/ikiwiki
index 7f6480e0c..79b7eff90 100755
--- a/ikiwiki
+++ b/ikiwiki
@@ -424,26 +424,31 @@ sub globlist_match ($$) { #{{{
return 0;
} #}}}
-# main {{{
-if ($config{setup}) {
- require IkiWiki::Setup;
- setup();
-}
-lockwiki();
-if ($config{wrapper}) {
- require IkiWiki::Wrapper;
- gen_wrapper();
- exit;
-}
-loadindex() unless $config{rebuild};
-if ($config{cgi}) {
- require IkiWiki::CGI;
- cgi();
-}
-else {
- require IkiWiki::Render;
- rcs_update();
- refresh();
- saveindex();
-}
-#}}}
+sub main () { #{{{
+ if ($config{setup}) {
+ require IkiWiki::Setup;
+ setup();
+ }
+
+ lockwiki();
+
+ if ($config{wrapper}) {
+ require IkiWiki::Wrapper;
+ gen_wrapper();
+ exit;
+ }
+
+ if ($config{cgi}) {
+ require IkiWiki::CGI;
+ cgi();
+ }
+ else {
+ loadindex() unless $config{rebuild};
+ require IkiWiki::Render;
+ rcs_update();
+ refresh();
+ saveindex();
+ }
+} #}}}
+
+main;