Fix relative config path #171
This commit is contained in:
+5
-3
@@ -8,7 +8,7 @@ import (
|
|||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@@ -52,8 +52,10 @@ func Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ConfigPath != "" {
|
if ConfigPath != "" {
|
||||||
if cwd, err := os.Getwd(); err == nil {
|
if !filepath.IsAbs(ConfigPath) {
|
||||||
ConfigPath = path.Join(cwd, ConfigPath)
|
if cwd, err := os.Getwd(); err == nil {
|
||||||
|
ConfigPath = filepath.Join(cwd, ConfigPath)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Info["config_path"] = ConfigPath
|
Info["config_path"] = ConfigPath
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user