From 3ea90a0787748e138bba216cb625b19451d9869c Mon Sep 17 00:00:00 2001 From: Pixelastic Date: Fri, 6 Mar 2020 10:18:56 +0100 Subject: [PATCH] Add a --no-2fa option (#398) --- readme.md | 1 + source/cli.js | 5 +++++ source/index.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 72f862c7..c3db12f3 100644 --- a/readme.md +++ b/readme.md @@ -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 diff --git a/source/cli.js b/source/cli.js index fd0be0c4..7f3ebf56 100755 --- a/source/cli.js +++ b/source/cli.js @@ -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 @@ -71,6 +72,10 @@ const cli = meow(` }, preview: { type: 'boolean' + }, + '2fa': { + type: 'boolean', + default: true } } }); diff --git a/source/index.js b/source/index.js index 562b9dd9..0d1530be 100644 --- a/source/index.js +++ b/source/index.js @@ -215,7 +215,7 @@ module.exports = async (input = 'patch', options) => { ]); const isExternalRegistry = npm.isExternalRegistry(pkg); - if (!options.exists && !pkg.private && !isExternalRegistry) { + if (options['2Fa'] && !options.exists && !pkg.private && !isExternalRegistry) { tasks.add([ { title: 'Enabling two-factor authentication',