cli: Stop config.json search sooner if TREE_SITTER_DIR set

This commit is contained in:
sogaiu 2023-01-16 14:24:16 +09:00
parent adeb8d0aa9
commit 23ce370fa3

View file

@ -25,6 +25,9 @@ impl Config {
if let Ok(path) = env::var("TREE_SITTER_DIR") {
let mut path = PathBuf::from(path);
path.push("config.json");
if !path.exists() {
return Ok(None);
}
if path.is_file() {
return Ok(Some(path));
}