diff options
Diffstat (limited to 'pkgs/by-name/fu/fupdate/src')
-rw-r--r-- | pkgs/by-name/fu/fupdate/src/main.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/pkgs/by-name/fu/fupdate/src/main.rs b/pkgs/by-name/fu/fupdate/src/main.rs index e664628a..b4af6cd6 100644 --- a/pkgs/by-name/fu/fupdate/src/main.rs +++ b/pkgs/by-name/fu/fupdate/src/main.rs @@ -33,16 +33,12 @@ fn main() -> Result<(), anyhow::Error> { // println!("Running: `fupdate-{command} {}`", args.join(" ")); - let mut child = Command::new(format!("fupdate-{command}")) + let child = Command::new(format!("fupdate-{command}")) .args(args) - .spawn() + .status() .with_context(|| format!("Failed to spawn `fupdate-{command}`"))?; - if !child - .wait() - .with_context(|| format!("Failed to wait for `fupdate-{command}` to finish"))? - .success() - { + if !child.success() { bail!("Command `fupdate-{command} {}` failed!", args.join(" ")); } } @@ -50,7 +46,12 @@ fn main() -> Result<(), anyhow::Error> { Ok(()) } -#[test] -fn verify_cli() { - CliArgs::command().debug_assert(); +#[cfg(test)] +mod test { + use clap::CommandFactory; + + #[test] + fn verify_cli() { + super::CliArgs::command().debug_assert(); + } } |