mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-22 21:04:07 +08:00
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 path
This commit is contained in:
parent
bf8b6f4c2c
commit
97f1efbb72
@ -13,12 +13,14 @@ import (
|
||||
|
||||
func InitConfig() {
|
||||
if flags.ForceBinDir {
|
||||
ex, err := os.Executable()
|
||||
if err != nil {
|
||||
utils.Log.Fatal(err)
|
||||
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, flags.DataDir)
|
||||
}
|
||||
exPath := filepath.Dir(ex)
|
||||
flags.DataDir = filepath.Join(exPath, "data")
|
||||
}
|
||||
configPath := filepath.Join(flags.DataDir, "config.json")
|
||||
log.Infof("reading config file: %s", configPath)
|
||||
|
Loading…
x
Reference in New Issue
Block a user