We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
--force-bin-dir
--data
1 parent bf8b6f4 commit 97f1efbCopy full SHA for 97f1efb
internal/bootstrap/config.go
@@ -13,12 +13,14 @@ import (
13
14
func InitConfig() {
15
if flags.ForceBinDir {
16
- ex, err := os.Executable()
17
- if err != nil {
18
- utils.Log.Fatal(err)
+ if !filepath.IsAbs(flags.DataDir) {
+ ex, err := os.Executable()
+ if err != nil {
19
+ utils.Log.Fatal(err)
20
+ }
21
+ exPath := filepath.Dir(ex)
22
+ flags.DataDir = filepath.Join(exPath, flags.DataDir)
23
}
- exPath := filepath.Dir(ex)
- flags.DataDir = filepath.Join(exPath, "data")
24
25
configPath := filepath.Join(flags.DataDir, "config.json")
26
log.Infof("reading config file: %s", configPath)
0 commit comments