diff --git a/cmd/cyrene/wire.go b/cmd/cyrene/wire.go index 9c7d644..0ec8679 100644 --- a/cmd/cyrene/wire.go +++ b/cmd/cyrene/wire.go @@ -480,10 +480,11 @@ func (a *app) close(ctx context.Context) { a.log.Info("cyrene shutdown complete") } -// resolveDataDir returns the configured data directory, or the OS-appropriate -// default when DATA_DIR is not exported to the process environment. +// resolveDataDir returns the configured data directory (from .env / env, via +// cfg.DataDir), falling back to the OS-appropriate default only when no +// directory is configured. func resolveDataDir(cfg *config.Config) string { - if _, ok := os.LookupEnv("DATA_DIR"); ok { + if cfg.DataDir != "" { return cfg.DataDir } return platform.DefaultDataDir()