fix(cli): Avoid ENOENT if config.json is not in TREE_SITTER_DIR
Fixes #1222.
This commit is contained in:
parent
af675f5426
commit
09e2e9fe87
1 changed files with 3 additions and 1 deletions
|
|
@ -24,7 +24,9 @@ impl Config {
|
|||
if let Ok(path) = env::var("TREE_SITTER_DIR") {
|
||||
let mut path = PathBuf::from(path);
|
||||
path.push("config.json");
|
||||
return Ok(Some(path));
|
||||
if path.is_file() {
|
||||
return Ok(Some(path));
|
||||
}
|
||||
}
|
||||
|
||||
let xdg_path = Self::xdg_config_file()?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue