diff options
author | Dan Buch <dan@meatballhat.com> | 2023-09-14 10:53:05 +0000 |
---|---|---|
committer | Dan Buch <dan@meatballhat.com> | 2023-09-27 00:17:40 +0000 |
commit | 14f76a96e8c25caa9f1cd278f4799e4ad37e2bb4 (patch) | |
tree | 81ab7374b25a10a57a11e0d3b1902212506b3975 /pkgs/build-support | |
parent | 3ffce56f46a454bf912a6b7043063f734eef8c21 (diff) |
fetch-yarn-deps: warn on undefined expected hash
instead of rejecting, given that the expected hash may not be known/provided.
Diffstat (limited to 'pkgs/build-support')
-rwxr-xr-x | pkgs/build-support/node/fetch-yarn-deps/index.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/build-support/node/fetch-yarn-deps/index.js b/pkgs/build-support/node/fetch-yarn-deps/index.js index 04f47362b10dc..de2a09ee90415 100755 --- a/pkgs/build-support/node/fetch-yarn-deps/index.js +++ b/pkgs/build-support/node/fetch-yarn-deps/index.js @@ -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)) |