Skip to content

Commit

Permalink
Merge pull request #1506 from cachix/fix-update-input-warning
Browse files Browse the repository at this point in the history
devenv: fix warning about `--update-input` when running `devenv update`
  • Loading branch information
domenkozar authored Oct 8, 2024
2 parents 4bcf93e + 135255b commit f16bfde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
3 changes: 2 additions & 1 deletion devenv-eval-cache/src/internal_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ impl InternalLog {
// to filter things out. Our hunch is that these messages are coming from the
// nix daemon.
InternalLog::Msg { msg, level, .. }
if *level == Verbosity::Error && (self.is_nix_error() || self.is_builtin_trace()) =>
if *level == Verbosity::Error
&& (self.is_nix_error() || self.is_builtin_trace()) =>
{
Some(msg.clone())
}
Expand Down
20 changes: 7 additions & 13 deletions devenv/src/cnix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,20 +217,14 @@ impl<'a> Nix<'a> {
}

pub async fn update(&self, input_name: &Option<String>) -> Result<()> {
match input_name {
Some(input_name) => {
self.run_nix(
"nix",
&["flake", "lock", "--update-input", input_name],
&self.options,
)
.await?;
}
None => {
self.run_nix("nix", &["flake", "update"], &self.options)
.await?;
}
let mut args = vec!["flake", "update"];

if let Some(input_name) = input_name {
args.push(input_name);
}

self.run_nix("nix", &args, &self.options).await?;

Ok(())
}

Expand Down

0 comments on commit f16bfde

Please sign in to comment.