return $dir;
}
-sub import (@) {
- my $this=shift;
- IkiWiki::Setup::merge({@_});
+sub sanitize_wikiname ($) {
+ my $wikiname=shift;
# Sanitize this to avoid problimatic directory names.
- $config{wikiname}=~s/[^-A-Za-z0-9_]//g;
- if (! length $config{wikiname}) {
+ $wikiname=~s/[^-A-Za-z0-9_]//g;
+ if (! length $wikiname) {
error gettext("you must enter a wikiname (that contains alphanumerics)");
}
+ return $wikiname;
+}
+
+sub import (@) {
+ my $this=shift;
+ IkiWiki::Setup::merge({@_});
# Avoid overwriting any existing files.
foreach my $key (qw{srcdir destdir repository dumpsetup}) {