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 { | ||||
| 		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…
	
		Reference in New Issue
	
	 Noah Hsu
						Noah Hsu