From cee2d26205bf8b5aee9f533527399d19a8635fcb Mon Sep 17 00:00:00 2001 From: Aska Date: Sun, 6 Sep 2026 10:32:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(wire):=20resolveDataDir=20=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20cfg.DataDir=EF=BC=88.env=20=E7=9A=84=20DATA=5FDIR?= =?UTF-8?q?=20=E7=9C=9F=E6=AD=A3=E7=94=9F=E6=95=88=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E8=90=BD=E5=B9=B3=E5=8F=B0=E9=BB=98=E8=AE=A4=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/cyrene/wire.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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()