add new wiki to wikilist

master
Joey Hess 2008-07-27 16:01:29 -04:00
parent 929a70a16d
commit 950850f639
2 changed files with 12 additions and 1 deletions

View 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}) {

View File

@ -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";
}