Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions test/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 () {
Expand Down