configure: don't set ensure if tarball is set

If you're providing a path to a header tarball to install, you probably
want it to always be re-installed.

PR-URL: https://github.com/nodejs/node-gyp/pull/1220
Fixes: https://github.com/nodejs/node-gyp/issues/1216
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit is contained in:
Gibson Fahnestock 2017-06-07 17:02:57 +01:00 committed by Ben Noordhuis
parent 4c38707087
commit 0a07e481f7

View file

@ -72,8 +72,10 @@ function configure (gyp, argv, callback) {
return callback(new Error('Invalid version number: ' + release.version))
}
// ensure that the target node version's dev files are installed
gyp.opts.ensure = true
// If the tarball option is set, always remove and reinstall the headers
// into devdir. Otherwise only install if they're not already there.
gyp.opts.ensure = gyp.opts.tarball ? false : true
gyp.commands.install([ release.version ], function (err, version) {
if (err) return callback(err)
log.verbose('get node dir', 'target node version installed:', release.versionDir)