fix(init): don't prompt to reconfigure
This allows the command to be used in scripts or CI
This commit is contained in:
parent
608506cb57
commit
c3d45a0153
1 changed files with 2 additions and 9 deletions
|
|
@ -443,15 +443,8 @@ impl InitConfig {
|
|||
|
||||
impl Init {
|
||||
fn run(self, current_dir: &Path, migrated: bool) -> Result<()> {
|
||||
let configure_json = if current_dir.join("tree-sitter.json").exists() {
|
||||
Confirm::with_theme(&ColorfulTheme::default())
|
||||
.with_prompt("It looks like you already have a `tree-sitter.json` file. Do you want to re-configure it?")
|
||||
.interact()?
|
||||
} else if current_dir.join("package.json").exists() {
|
||||
!migrated
|
||||
} else {
|
||||
true
|
||||
};
|
||||
let configure_json = !current_dir.join("tree-sitter.json").exists()
|
||||
&& (!current_dir.join("package.json").exists() || !migrated);
|
||||
|
||||
let (language_name, json_config_opts) = if configure_json {
|
||||
let mut opts = JsonConfigOpts::default();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue