Ignore global libvips during install via SHARP_IGNORE_GLOBAL_LIBVIPS (#1165)

This commit is contained in:
Thomas Parisot
2018-03-22 18:48:30 +00:00
committed by Lovell Fuller
parent 8dac256096
commit 0d7c3fc4d8
3 changed files with 24 additions and 5 deletions

View File

@@ -46,6 +46,10 @@ const pkgConfigPath = function () {
};
const useGlobalLibvips = function () {
if (Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS) === true) {
return false;
}
const globalVipsVersion = globalLibvipsVersion();
return !!globalVipsVersion && semver.gte(globalVipsVersion, minimumLibvipsVersion);
};