统一桌面服务环境配置加载
This commit is contained in:
1 parent
ed7b9ef5ed
commit
01dfda888a
3 files changed
+59
-1
No files matched your search
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user