default config relative path only required if $PWD doesnt exist

This commit is contained in:
zonyitoo
2021-11-27 21:24:41 +08:00
parent 5292a25db3
commit 18d042fa57
+6 -6
View File
@@ -14,12 +14,12 @@ pub fn get_default_config_path() -> Option<PathBuf> {
if path.exists() {
return Some(path);
}
}
// config.json in the current working directory (relative path)
let relative_path = PathBuf::from("config.json");
if relative_path.exists() {
return Some(relative_path);
} else {
// config.json in the current working directory (relative path)
let relative_path = PathBuf::from("config.json");
if relative_path.exists() {
return Some(relative_path);
}
}
// System standard directories