Skip to content

Commit

Permalink
Merge pull request #63 from adumbidiot/issue-24
Browse files Browse the repository at this point in the history
Use error from stderr if stdout is empty
  • Loading branch information
jyn514 authored Aug 12, 2022
2 parents e3b67bd + 82ac4d4 commit f24188b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,11 @@ fn lookup_from_names<'a>(
let out = Command::new("rustc").args(args).output()?;

if !out.status.success() {
bail!(String::from_utf8_lossy(&out.stdout).to_string());
if !out.stdout.is_empty() {
bail!(String::from_utf8_lossy(&out.stdout).to_string());
} else {
bail!(String::from_utf8_lossy(&out.stderr).to_string());
}
}
Ok(hash_u64(&String::from_utf8_lossy(&out.stdout)))
})
Expand Down

0 comments on commit f24188b

Please sign in to comment.