Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ToyVo committed Dec 1, 2024
1 parent f876b18 commit ffedc3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
11 changes: 6 additions & 5 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down
13 changes: 5 additions & 8 deletions src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ pub fn update(installable: &Installable, input: Option<String>) -> 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!(
Expand All @@ -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()?;

Expand Down

0 comments on commit ffedc3e

Please sign in to comment.