From 50cb619a542d5014956ebfa195a9143f0f6ea7d6 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Tue, 12 Nov 2024 17:46:28 +0530 Subject: [PATCH] Exit --- cli/tools/registry/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index 65239669ce..19e0b33453 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -856,6 +856,7 @@ async fn perform_publish( assert_eq!(prepared_package_by_name.len(), authorizations.len()); let mut futures: FuturesUnordered>> = Default::default(); + let mut has_errors = false; loop { let next_batch = publish_order_graph.next(); @@ -911,12 +912,19 @@ async fn perform_publish( publish_order_graph.finish_package(&package_name); } Err(err) => { + has_errors = true; #[allow(clippy::print_stderr)] - eprintln!("{}: {}", colors::red("Error publishing"), err); + { + eprintln!("{}: {}", colors::red("Error publishing"), err); + } } } } + if has_errors { + std::process::exit(1); + } + Ok(()) }