mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
fetch-yarn-deps: warn on undefined expected hash
instead of rejecting, given that the expected hash may not be known/provided.
This commit is contained in:
parent
3ffce56f46
commit
14f76a96e8
@ -37,7 +37,9 @@ const downloadFileHttps = (fileName, url, expectedHash, hashType = 'sha1') => {
|
||||
res.on('end', () => {
|
||||
file.close()
|
||||
const h = hash.read()
|
||||
if (h != expectedHash) return reject(new Error(`hash mismatch, expected ${expectedHash}, got ${h}`))
|
||||
if (expectedHash === undefined){
|
||||
console.log(`Warning: lockfile url ${url} doesn't end in "#<hash>" to validate against. Downloaded file had hash ${h}.`);
|
||||
} else if (h != expectedHash) return reject(new Error(`hash mismatch, expected ${expectedHash}, got ${h}`))
|
||||
resolve()
|
||||
})
|
||||
res.on('error', e => reject(e))
|
||||
|
Loading…
Reference in New Issue
Block a user