Skip to content

Commit

Permalink
show config file path after creating, also in last warning msg
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Jan 13, 2025
1 parent 25ddae0 commit a0d1a0a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main_gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func runServerOnly(createConfig bool) {
}
}
if !conf.WebEnable {
slog.Warn("Web is not enabled, set web_enable = true in config.toml file")
slog.Warn("Web is not enabled, set web_enable = true in " + config.Path())
}
dictmgr.InitDicts(conf)
server.StartServer(conf.LocalServerPorts[0])
Expand Down
2 changes: 1 addition & 1 deletion main_no_gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {
}
}
if !conf.WebEnable {
slog.Warn("Web is not enabled, set web_enable = true in config.toml file")
slog.Warn("Web is not enabled, set web_enable = true in " + config.Path())
}

dictmgr.InitDicts(conf)
Expand Down
8 changes: 7 additions & 1 deletion pkg/config/config_save.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package config

import (
"bytes"
"log/slog"
"os"
"runtime"
"time"
Expand Down Expand Up @@ -44,5 +45,10 @@ func EnsureExists(conf *Config) error {
if !os.IsNotExist(err) {
return err
}
return Save(conf)
err = Save(conf)
if err != nil {
return err
}
slog.Info("Created config file: " + Path())
return nil
}

0 comments on commit a0d1a0a

Please sign in to comment.