diff --git a/src/commands.rs b/src/commands.rs index ba00f1e..2636c68 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -75,19 +75,20 @@ impl Command { .stdout(Redirection::Pipe) .capture()? .stdout_str() - .contains("--preserve-env") { + .contains("--preserve-env") + { &["--set-home", "--preserve-env=PATH", "env"] } else { &["--set-home"] - } + }, ); cmd.arg(&self.command).args(&self.args) } else { Exec::cmd(&self.command).args(&self.args) } - .stderr(Redirection::None) - .stdout(Redirection::None); + .stderr(Redirection::None) + .stdout(Redirection::None); if let Some(m) = &self.message { info!("{}", m); @@ -188,7 +189,7 @@ impl Build { .stderr(Redirection::Merge) | Exec::cmd("nom").args(&["--json"]) } - .stdout(Redirection::None); + .stdout(Redirection::None); debug!(?cmd); cmd.join() } else { diff --git a/src/update.rs b/src/update.rs index 608db9d..93e3f32 100644 --- a/src/update.rs +++ b/src/update.rs @@ -31,7 +31,10 @@ pub fn update(installable: &Installable, input: Option) -> Result<()> { pub fn pull(installable: &Installable) -> Result<()> { match installable { Installable::Flake { reference, .. } => { - Command::new("git").args(["-C", reference, "pull"]).message("Pulling flake").run()?; + Command::new("git") + .args(["-C", reference, "pull"]) + .message("Pulling flake") + .run()?; } _ => { warn!( @@ -47,13 +50,7 @@ pub fn pull(installable: &Installable) -> Result<()> { pub fn check_for_conflicts(installable: &Installable) -> Result<()> { if let Installable::Flake { reference, .. } = installable { let status = Command::new("git") - .args([ - "-C", - reference, - "diff", - "--name-only", - "--diff-filter=U", - ]) + .args(["-C", reference, "diff", "--name-only", "--diff-filter=U"]) .message("Checking for conflicts") .run_capture()?;