Skip to content

Commit

Permalink
always print install errors
Browse files Browse the repository at this point in the history
  • Loading branch information
daywalker90 committed Feb 25, 2024
1 parent 6a1746e commit dbf2c9f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions coffee_cmd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ async fn run(args: CoffeeArgs, mut coffee: CoffeeManager) -> Result<(), CoffeeEr
} else {
None
};
let result = coffee.install(&plugin, verbose, dynamic).await;
if let Some(spinner) = spinner {
if result.is_ok() {
spinner.finish();
} else {
spinner.failed();
match coffee.install(&plugin, verbose, dynamic).await {
Ok(_) => {
spinner.and_then(|spinner| Some(spinner.finish()));
if verbose {
term::success!("Plugin {plugin} Compiled and Installed")
}
}
Err(err) => {
spinner.and_then(|spinner| Some(spinner.failed()));
term::error(format!("{err}"))
}
} else if result.is_ok() {
term::success!("Plugin {plugin} Compiled and Installed")
}
}
CoffeeCommand::Remove { plugin } => {
Expand Down

0 comments on commit dbf2c9f

Please sign in to comment.