Print eval failures to the debug log.

This commit is contained in:
r-vdp 2023-03-29 11:38:29 +02:00
parent 4b1c70daf7
commit 1e9d3be430
No known key found for this signature in database

View file

@ -157,13 +157,13 @@ fn try_nix_eval(flake_uri: &str) -> Result<bool> {
.arg("--json") .arg("--json")
.arg("--apply") .arg("--apply")
.arg("a: a ? outPath") .arg("a: a ? outPath")
.stderr(process::Stdio::null())
.output()?; .output()?;
if output.status.success() { if output.status.success() {
let stdout = String::from_utf8(output.stdout)?; let stdout = String::from_utf8(output.stdout)?;
let parsed_output: bool = serde_json::from_str(&stdout)?; let parsed_output: bool = serde_json::from_str(&stdout)?;
Ok(parsed_output) Ok(parsed_output)
} else { } else {
log::debug!("{}", String::from_utf8_lossy(output.stderr.as_ref()));
Ok(false) Ok(false)
} }
} }