Skip to content

Commit b3e3219

Browse files
committed
better default handling in prompts
1 parent 3b9acc1 commit b3e3219

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/prompts.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,22 +106,22 @@ async function promptForScripts (opts = {}, options = {}) {
106106
name: 'prepare',
107107
message: 'Prepare script [run before publish and on local install]:',
108108
default: s.prepare,
109-
when: opts.extended && (!options.scripts || !options.scripts.prepare)
109+
when: opts.extended && (!options.scripts || typeof options.scripts.prepare === 'undefined')
110110
}, {
111111
name: 'prepublushOnly',
112112
message: 'Pre publush script [run only before publish]:',
113113
default: s.prepublushOnly || 'npm t',
114-
when: !options.scripts || !options.scripts.prepublushOnly
114+
when: !options.scripts || typeof options.scripts.prepublishOnly === 'undefined'
115115
}, {
116116
name: 'postpublish',
117117
message: 'Post publish script:',
118118
default: s.postpublish,
119-
when: opts.extended && (!options.scripts || !options.scripts.postpublish)
119+
when: opts.extended && (!options.scripts || typeof options.scripts.postpublish === 'undefined')
120120
}, {
121121
name: 'preversion',
122122
message: 'Pre version script:',
123123
default: s.preversion,
124-
when: opts.extended && (!options.scripts || !options.scripts.preversion)
124+
when: opts.extended && (!options.scripts || typeof options.scripts.preversion === 'undefined')
125125
}])
126126

127127
// Merge scripts and add any customs

0 commit comments

Comments
 (0)