Improve error message if libvips tarball is corrupt

This commit is contained in:
Lovell Fuller 2019-03-17 23:07:58 +00:00
parent 9cc06c887b
commit 9ee377963e

View File

@ -34,7 +34,12 @@ const extractTarball = function (tarPath) {
cwd: vendorPath,
strict: true
})
.catch(fail);
.catch(function (err) {
if (/unexpected end of file/.test(err.message)) {
npmLog.error('sharp', `Please delete ${tarPath} as it is not a valid tarball`);
}
fail(err);
});
};
try {