aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-14 22:42:27 -0400
committerhistoria <[not public]>2026-06-14 22:42:27 -0400
commiteb37418b933d7bd996658209e867ea3f3e3806ec (patch)
tree9988922fe95300a83177b76bcdfb9420c240c655 /cmd
parenta6f0ad79e2e3a5b7c11eef1ffc3233f3a2766f77 (diff)
downloadthehouseoficarus-eb37418b933d7bd996658209e867ea3f3e3806ec.tar.gz
feat: default config file generated if doesn't exist
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mud/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/mud/main.go b/cmd/mud/main.go
index cc8c96b..6940cd6 100644
--- a/cmd/mud/main.go
+++ b/cmd/mud/main.go
@@ -26,7 +26,10 @@ func main() {
cfg, err := config.Load(*configPath)
if err != nil {
if os.IsNotExist(err) {
- log.Printf("config file %s not found, using defaults (telnet :4000)", *configPath)
+ log.Printf("config file %s not found, creating with defaults", *configPath)
+ if err := config.SaveDefault(*configPath); err != nil {
+ log.Fatalf("failed to create config: %v", err)
+ }
cfg = config.Default()
} else {
log.Fatalf("failed to load config: %v", err)