Install: libvips check takes precedence over flag

This commit is contained in:
Lovell Fuller 2023-09-27 16:20:04 +01:00
parent 3043e01171
commit 59327bdd53

View File

@ -12,16 +12,16 @@ const buildFromSource = (msg) => {
require('node-gyp'); require('node-gyp');
} catch (err) { } catch (err) {
log('You might need to install node-gyp'); log('You might need to install node-gyp');
log('See https://sharp.pixelplumbing.com/install#building-from-source');
} }
log('See https://sharp.pixelplumbing.com/install#building-from-source');
const status = gypRebuild(); const status = gypRebuild();
if (status !== 0) { if (status !== 0) {
process.exit(status); process.exit(status);
} }
}; };
if (process.env.npm_config_build_from_source) { if (useGlobalLibvips()) {
buildFromSource('Detected --build-from-source flag');
} else if (useGlobalLibvips()) {
buildFromSource(`Detected globally-installed libvips v${globalLibvipsVersion()}`); buildFromSource(`Detected globally-installed libvips v${globalLibvipsVersion()}`);
} else if (process.env.npm_config_build_from_source) {
buildFromSource('Detected --build-from-source flag');
} }