Skip to content

Commit

Permalink
Merge pull request #141 from NotAShelf/fix-search
Browse files Browse the repository at this point in the history
fix indefinite hang on nh search
  • Loading branch information
viperML authored Aug 7, 2024
2 parents dda613e + 910bf57 commit 7016ac6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,13 @@ impl NHRunnable for SearchArgs {
}

fn my_nix_branch(flake: &FlakeRef) -> Result<String> {
let mut child = std::process::Command::new("nix")
let output = std::process::Command::new("nix")
.args(["flake", "metadata", "--json"])
.arg(flake.as_str())
.stderr(Stdio::inherit())
.stdout(Stdio::piped())
.spawn()?;
.output()?;

child.wait()?;

let stdout = child.stdout.take().wrap_err("Couldn't get stdout")?;

let mut metadata: FlakeMetadata = serde_json::from_reader(stdout)?;
let stdout = String::from_utf8(output.stdout)?;
let mut metadata: FlakeMetadata = serde_json::from_str(&stdout)?;

let branch = metadata
.locks
Expand Down

0 comments on commit 7016ac6

Please sign in to comment.