mirror of https://github.com/Xhofe/alist
feat!: disable `--force-bin-dir` if `--data` is abs
related issues: #2580 #2542 after this commit, the `--force-bin-dir` would take no effect if `--data` is absolute pathpull/2587/head
parent
bf8b6f4c2c
commit
97f1efbb72
|
@ -13,12 +13,14 @@ import (
|
|||
|
||||
func InitConfig() {
|
||||
if flags.ForceBinDir {
|
||||
if !filepath.IsAbs(flags.DataDir) {
|
||||
ex, err := os.Executable()
|
||||
if err != nil {
|
||||
utils.Log.Fatal(err)
|
||||
}
|
||||
exPath := filepath.Dir(ex)
|
||||
flags.DataDir = filepath.Join(exPath, "data")
|
||||
flags.DataDir = filepath.Join(exPath, flags.DataDir)
|
||||
}
|
||||
}
|
||||
configPath := filepath.Join(flags.DataDir, "config.json")
|
||||
log.Infof("reading config file: %s", configPath)
|
||||
|
|
Loading…
Reference in New Issue