统一桌面服务环境配置加载

This commit is contained in:
xuans committed 2026-08-31 01:17:37 +08:00
1 parent ed7b9ef5ed
commit 01dfda888a
3 files changed
+59 -1

No files matched your search

+7 -1
View File
@@ -28,12 +28,18 @@ func Open(configPath, baseDir string) (*Runtime, error) {
baseDir = filepath.Dir(filepath.Dir(configPath))
}
cfg, err := config.Load(configPath)
cfg, err := config.LoadWithEnv(configPath)
if err != nil {
if !errors.Is(err, os.ErrNotExist) {
return nil, err
}
cfg = defaultConfig(baseDir)
if err := cfg.ApplyEnvironment(); err != nil {
return nil, err
}
if err := cfg.Validate(); err != nil {
return nil, err
}
}
ctx, cancel := context.WithCancel(context.Background())