mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Install: log possible error when removing vendor dir
This commit is contained in:
parent
391018ad3d
commit
d08baa20e6
@ -77,7 +77,11 @@ const verifyIntegrity = function (platformAndArch) {
|
|||||||
flush: function (done) {
|
flush: function (done) {
|
||||||
const digest = `sha512-${hash.digest('base64')}`;
|
const digest = `sha512-${hash.digest('base64')}`;
|
||||||
if (expected !== digest) {
|
if (expected !== digest) {
|
||||||
libvips.removeVendoredLibvips();
|
try {
|
||||||
|
libvips.removeVendoredLibvips();
|
||||||
|
} catch (err) {
|
||||||
|
libvips.log(err.message);
|
||||||
|
}
|
||||||
libvips.log(`Integrity expected: ${expected}`);
|
libvips.log(`Integrity expected: ${expected}`);
|
||||||
libvips.log(`Integrity received: ${digest}`);
|
libvips.log(`Integrity received: ${digest}`);
|
||||||
done(new Error(`Integrity check failed for ${platformAndArch}`));
|
done(new Error(`Integrity check failed for ${platformAndArch}`));
|
||||||
|
@ -88,8 +88,7 @@ const hasVendoredLibvips = function () {
|
|||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
const removeVendoredLibvips = function () {
|
const removeVendoredLibvips = function () {
|
||||||
const rm = fs.rmSync ? fs.rmSync : fs.rmdirSync;
|
fs.rmSync(vendorPath, { recursive: true, maxRetries: 3, force: true });
|
||||||
rm(vendorPath, { recursive: true, maxRetries: 3, force: true });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user