Skip to content

Commit

Permalink
Add a --no-2fa option (sindresorhus#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelastic committed Jul 2, 2020
1 parent 1f701cd commit e6d52ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ $ np --help
--no-yarn Don't use Yarn
--contents Subdirectory to publish
--no-release-draft Skips opening a GitHub release draft
--no-2fa Don't enable 2FA on new packages
Examples
$ np
Expand Down
5 changes: 5 additions & 0 deletions source/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const cli = meow(`
--no-yarn Don't use Yarn
--contents Subdirectory to publish
--no-release-draft Skips opening a GitHub release draft
--no-2fa Don't enable 2FA on new packages
Examples
$ np
Expand Down Expand Up @@ -70,6 +71,10 @@ const cli = meow(`
},
preview: {
type: 'boolean'
},
'2fa': {
type: 'boolean',
default: true
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ module.exports = async (input = 'patch', options) => {
]);

const isExternalRegistry = npm.isExternalRegistry(pkg);
if (options.availability.isAvailable && !options.availability.isUnknown && !pkg.private && !isExternalRegistry) {
if (options['2Fa'] && options.availability.isAvailable && !options.availability.isUnknown && !pkg.private && !isExternalRegistry) {
tasks.add([
{
title: 'Enabling two-factor authentication',
Expand Down

0 comments on commit e6d52ad

Please sign in to comment.