Skip to content

Commit a9a5b77

Browse files
committed
fix: private option uses the real config to determine default
1 parent 8571d3c commit a9a5b77

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/default-input.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,5 +280,9 @@ exports.type = yes ? type : prompt('type', type, (data) => {
280280
// Only include private field if it already exists or if explicitly set in config
281281
const configPrivate = getConfig('private')
282282
if (package.private !== undefined || configPrivate !== undefined) {
283-
exports.private = package.private !== undefined ? package.private : configPrivate
283+
if (package.private !== undefined) {
284+
exports.private = package.private
285+
} else if (!config.isDefault || !config.isDefault('init-private')) {
286+
exports.private = configPrivate
287+
}
284288
}

0 commit comments

Comments
 (0)