fix(cli): Avoid ENOENT if config.json is not in TREE_SITTER_DIR
Fixes
@@ -24,8 +24,10 @@ impl Config {
if let Ok(path) = env::var("TREE_SITTER_DIR") {
let mut path = PathBuf::from(path);
path.push("config.json");
+ if path.is_file() {
return Ok(Some(path));
}
+ }
let xdg_path = Self::xdg_config_file()?;
if xdg_path.is_file() {
