From d9cc83f4e775ed7f59cf21f350b2140c29cf6b07 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 23 Feb 2026 13:52:08 +0900 Subject: refactor(cli): replace std::process::exit() with bail_silent in command handlers Improves testability and ensures proper resource cleanup by returning errors through the existing MozartError/exit_code mechanism instead of terminating the process directly. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/commands/reinstall.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/mozart/src/commands/reinstall.rs') diff --git a/crates/mozart/src/commands/reinstall.rs b/crates/mozart/src/commands/reinstall.rs index 1665786..b38d9f7 100644 --- a/crates/mozart/src/commands/reinstall.rs +++ b/crates/mozart/src/commands/reinstall.rs @@ -153,7 +153,9 @@ pub async fn execute( if selected.is_empty() { eprintln!("Found no packages to reinstall, aborting."); - std::process::exit(1); + return Err(mozart_core::exit_code::bail_silent( + mozart_core::exit_code::GENERAL_ERROR, + )); } // Step 6: For each selected package, find its locked metadata. -- cgit v1.3.1