Add -print-example-config

This commit is contained in:
bouncepaw
2021-03-09 19:27:14 +05:00
parent d2792ff83d
commit e35643bb9d
7 changed files with 262 additions and 156 deletions
+7 -4
View File
@@ -33,7 +33,6 @@ type Authorization struct {
}
func ReadConfigFile(path string) {
log.Println("Loading config at", path)
cfg := &Config{
WikiName: "MycorrhizaWiki",
NaviTitleIcon: "🍄",
@@ -52,9 +51,13 @@ func ReadConfigFile(path string) {
FixedAuthCredentialsPath: "",
},
}
err := ini.MapTo(cfg, path)
if err != nil {
log.Fatal(err)
if path != "" {
log.Println("Loading config at", path)
err := ini.MapTo(cfg, path)
if err != nil {
log.Fatal(err)
}
}
SiteName = cfg.WikiName