修正相对路径处理逻辑

This commit is contained in:
lwch
2021-12-29 15:07:41 +08:00
parent 9e4d2210cb
commit e77a86bb1f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ func LoadConf(dir string) *Configure {
if cfg.Link.WriteTimeout <= 0 {
cfg.Link.WriteTimeout = 5 * time.Second
}
if filepath.IsAbs(cfg.Log.Dir) {
if !filepath.IsAbs(cfg.Log.Dir) {
dir, err := os.Executable()
runtime.Assert(err)
cfg.Log.Dir = filepath.Join(filepath.Dir(dir), cfg.Log.Dir)
+1 -1
View File
@@ -44,7 +44,7 @@ func LoadConf(dir string) *Configure {
} `yaml:"tls"`
}
runtime.Assert(yaml.Decode(dir, &cfg))
if filepath.IsAbs(cfg.Log.Dir) {
if !filepath.IsAbs(cfg.Log.Dir) {
dir, err := os.Executable()
runtime.Assert(err)
cfg.Log.Dir = filepath.Join(filepath.Dir(dir), cfg.Log.Dir)