From 8500e331ebfd49e66dd935b8a9c7a58aba68af37 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Wed, 2 Oct 2024 16:23:25 -0400 Subject: [PATCH] fix(init): do not migrate `package.json` on error --- cli/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index ad590e72..3c68d50d 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1300,7 +1300,10 @@ fn run() -> Result<()> { let migrated = if !current_dir.join("tree-sitter.json").exists() && current_dir.join("package.json").exists() { - migrate_package_json(¤t_dir).with_context(|| "Failed to migrate package.json")? + migrate_package_json(¤t_dir).is_ok_and(|_| { + eprintln!("Failed to migrate package.json"); + false + }) } else { false };