From 5e9e873e9a98544a4e29f5fdb2955e63a30afa7f Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Mon, 15 Apr 2024 07:10:01 +0200 Subject: [PATCH] error out with a new Error variant --- Cargo.lock | 4 ++-- crates/packager/src/cli/mod.rs | 3 ++- crates/packager/src/error.rs | 3 --- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b59bc92f..a97b4de8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Cargo. +r# This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 @@ -978,7 +978,7 @@ dependencies = [ [[package]] name = "cargo-packager" -version = "0.7.0" +rversion = "0.7.0" dependencies = [ "ar", "base64 0.21.7", diff --git a/crates/packager/src/cli/mod.rs b/crates/packager/src/cli/mod.rs index b612eb7e..e11b2849 100644 --- a/crates/packager/src/cli/mod.rs +++ b/crates/packager/src/cli/mod.rs @@ -135,7 +135,8 @@ fn run_cli(cli: Cli) -> Result<()> { }; if configs.is_empty() { - return Err(crate::Error::NoConfig); + tracing::error!("Couldn't detect a valid configuration file or all configurations are disabled! Nothing to do here."); + std::process::exit(1); } let cli_out_dir = cli.out_dir.as_ref().map(dunce::canonicalize).transpose()?; diff --git a/crates/packager/src/error.rs b/crates/packager/src/error.rs index a73d6440..b1557e49 100644 --- a/crates/packager/src/error.rs +++ b/crates/packager/src/error.rs @@ -32,9 +32,6 @@ pub enum Error { /// Target triple environment error #[error("Unable to determine target-environment")] Environment, - /// No config file found. - #[error("Couldn't detect a valid configuration file or all configurations are disabled.")] - NoConfig, /// I/O errors. #[error(transparent)] Io(#[from] std::io::Error),