Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Commit

Permalink
print stderr if prefetch-* command invocation fails
Browse files Browse the repository at this point in the history
Otherwise it’s pretty hard to figure out what went wrong.
  • Loading branch information
Profpatsch authored and kamilchm committed Apr 13, 2018
1 parent 2b0f2e5 commit 52270bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ func calculateHash(url, pathType string) (hash string) {
prefetchCmd := exec.Command("nix-prefetch-"+pathType, args...)
prefetchOut, err := prefetchCmd.Output()
if err != nil {
if exitErr, ok := err.(*exec.ExitError); ok {
log.Print(string(exitErr.Stderr))
}
log.Fatalf("Command %v %v failed: %v", prefetchCmd.Path, prefetchCmd.Args, err)
}
return hashFromNixPrefetch(pathType, prefetchOut)
Expand Down

0 comments on commit 52270bd

Please sign in to comment.