aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/fu/fupdate/src/main.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/by-name/fu/fupdate/src/main.rs b/pkgs/by-name/fu/fupdate/src/main.rs
index 850eaf87..759f65ec 100644
--- a/pkgs/by-name/fu/fupdate/src/main.rs
+++ b/pkgs/by-name/fu/fupdate/src/main.rs
@@ -12,7 +12,7 @@ fn main() -> Result<(), anyhow::Error> {
let args = CliArgs::parse();
- let other = args.command.first().map_or("flake", String::as_str);
+ let command = args.command.first().map_or("flake", String::as_str);
{
let args = if args.command.len() > 1 {
@@ -21,13 +21,19 @@ fn main() -> Result<(), anyhow::Error> {
&[]
};
- let status = Command::new(format!("fupdate-{other}"))
+ // println!("Running: `fupdate-{command} {}`", args.join(" "));
+
+ let mut child = Command::new(format!("fupdate-{command}"))
.args(args)
- .status()
- .with_context(|| format!("Failed to execute `fupdate-{other}`"))?;
+ .spawn()
+ .with_context(|| format!("Failed to spawn `fupdate-{command}`"))?;
- if !status.success() {
- bail!("Command `fupdate-{other}` failed!");
+ if !child
+ .wait()
+ .with_context(|| format!("Failed to wait for `fupdate-{command}` to finish"))?
+ .success()
+ {
+ bail!("Command `fupdate-{command} {}` failed!", args.join(" "));
}
}