diff --git a/lib/normalize.js b/lib/normalize.js index e806f11..32ed0a9 100644 --- a/lib/normalize.js +++ b/lib/normalize.js @@ -30,8 +30,7 @@ function normalize (data, warn, strict) { } if (data.scripts && - data.scripts.install === 'node-gyp rebuild' && - !data.scripts.preinstall) { + data.scripts.install === 'node-gyp rebuild') { data.gypfile = true } fixer.warn = function () { diff --git a/test/scripts.js b/test/scripts.js index d2a00e0..c0c2ed4 100644 --- a/test/scripts.js +++ b/test/scripts.js @@ -50,7 +50,7 @@ test('does not set gypfile when install script is different', function () { assert.strictEqual(data.gypfile, undefined, 'gypfile should not be set') }) -test('does not set gypfile when preinstall script exists', function () { +test('sets gypfile when preinstall script exists', function () { var data = { name: 'test-package', version: '1.0.0', @@ -60,7 +60,7 @@ test('does not set gypfile when preinstall script exists', function () { }, } normalize(data) - assert.strictEqual(data.gypfile, undefined, 'gypfile should not be set when preinstall exists') + assert.strictEqual(data.gypfile, true, 'gypfile should be set when preinstall exists') }) test('removes non-string script values', function () {