]> sipb.mit.edu Git - ikiwiki.git/commitdiff
add new wiki to wikilist
authorJoey Hess <joey@kodama.kitenet.net>
Sun, 27 Jul 2008 20:01:29 +0000 (16:01 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sun, 27 Jul 2008 20:01:29 +0000 (16:01 -0400)
IkiWiki/Setup/Automator.pm
ikiwiki-update-wikilist

index 202c5541c700c78848f191ee71e73c090490ffc7..b5cf8fb4849d26b1879f635d27914dfa01a7ff01 100644 (file)
@@ -110,6 +110,17 @@ sub import (@) { #{{{
                die "ikiwiki --wrappers --setup $config{dumpsetup} failed";
        }
 
+       # Add it to the wikiwiki.
+       mkpath("$ENV{HOME}/.ikiwiki");
+       open (WIKILIST, ">>$ENV{HOME}/.ikiwiki/wikilist") || die "$ENV{HOME}/.ikiwiki/wikilist: $!";
+       print WIKILIST "$ENV{USER} $config{dumpsetup}\n";
+       close WIKILIST;
+       if (system("ikiwiki-update-wikilist") != 0) {
+               print STDERR "** Failed to add you to the system wikilist file.\n";
+               print STDERR "** (Probably ikiwiki-update-wikilist is not SUID root.)\n";
+               print STDERR "** Your wiki will not be automatically updated when ikiwiki is upgraded.\n";
+       }
+       
        # Done!
        print "\n\nSuccessfully set up $config{wikiname}:\n";
        foreach my $key (qw{url srcdir destdir repository}) {
index 0b52543cda5bdfb3a1b1e6bbd03a0a697210a141..a6425f011c6a7e04c281cdfe8f70094d302818e5 100755 (executable)
@@ -45,7 +45,7 @@ if (! $seen && ! $remove) {
 }
 if ($changed) {
        close $list || die "ikiwiki-update-wikilist: error reading $list: $!\n";
-       open ($list, ">$wikilist") || die "ikiwiki-update-wikilist: error writing $wikilist: $!\n";
+       open ($list, ">$wikilist") || die "ikiwiki-update-wikilist: cannot write to $wikilist\n";
        foreach (@lines) {
                print $list "$_\n";
        }