From 18d042fa57b8293c60920e41cfb2827dcef4e58b Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Sat, 27 Nov 2021 21:24:41 +0800 Subject: [PATCH] default config relative path only required if $PWD doesnt exist --- src/config.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/config.rs b/src/config.rs index d05daf96..413418df 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,12 +14,12 @@ pub fn get_default_config_path() -> Option { 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