fix(cli): Don't silently overwrite existing config file

This commit is contained in:
Andrew Hlynskyi 2021-06-27 03:03:47 +03:00
parent 2b83500b74
commit 2e2b239c42
2 changed files with 7 additions and 1 deletions

View file

@ -20,7 +20,7 @@ pub struct Config {
}
impl Config {
fn find_config_file() -> Result<Option<PathBuf>> {
pub fn find_config_file() -> Result<Option<PathBuf>> {
if let Ok(path) = env::var("TREE_SITTER_DIR") {
let mut path = PathBuf::from(path);
path.push("config.json");