on master help sign in
Merge pull request #252 from obsidiansystems/fix-hash-prefetch

Fix hash prefetch: break on lines and ensure only one

commit49f11dc0e31fafe9fc5aad948fb40d1a5ac4d88f authorLuigy Leon <luichi.19@gmail.com> dateThu 18 Oct 2018, 17:45 (8 years ago) parentce7fbb1a51ad7c
1 file changed+2−1
lib/command/src/Obelisk/Command/Thunk.hs+2−1
lib/command/src/Obelisk/Command/Thunk.hs+2−1
@@ -137,8 +137,9 @@ getNixSha256ForUriUnpacked
137137 -> m NixSha256
138138getNixSha256ForUriUnpacked uri =
139139 withExitFailMessage ("nix-prefetch-url: Failed to determine sha256 hash of URL " <> T.pack (show uri)) $ do
140− withNixRemoteCheck $ readProcessAndLogStderr Debug $
140+ [hash] <- fmap T.lines $ withNixRemoteCheck $ readProcessAndLogStderr Debug $
141141 proc "nix-prefetch-url" ["--unpack" , "--type" , "sha256" , show uri]
142+ pure hash
142143
143144nixPrefetchGit :: MonadObelisk m => URI -> Text -> Bool -> m NixSha256
144145nixPrefetchGit uri rev fetchSubmodules =