From aabb153c7526a2fb5b20284bd18af7fdc9f3426c Mon Sep 17 00:00:00 2001 From: daywalker90 Date: Sun, 25 Feb 2024 14:20:24 +0100 Subject: [PATCH] always print install errors --- coffee_cmd/src/main.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/coffee_cmd/src/main.rs b/coffee_cmd/src/main.rs index d5708fa..e23e74a 100644 --- a/coffee_cmd/src/main.rs +++ b/coffee_cmd/src/main.rs @@ -27,14 +27,20 @@ async fn run(args: CoffeeArgs, mut coffee: CoffeeManager) -> Result<(), CoffeeEr None }; let result = coffee.install(&plugin, verbose, dynamic).await; - if let Some(spinner) = spinner { - if result.is_ok() { - spinner.finish(); - } else { - spinner.failed(); + match result { + Ok(_) => { + if let Some(spinner) = spinner { + spinner.finish(); + } else { + term::success!("Plugin {plugin} Compiled and Installed") + } + } + Err(err) => { + if let Some(spinner) = spinner { + spinner.failed(); + } + term::error(format!("{err}")) } - } else if result.is_ok() { - term::success!("Plugin {plugin} Compiled and Installed") } } CoffeeCommand::Remove { plugin } => {