Skip to content

Commit

Permalink
Don't ask for tag if --no-publish (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinesedfan authored and sindresorhus committed Nov 30, 2019
1 parent 8360cb6 commit 23524b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ module.exports = async (options, pkg) => {
type: 'list',
name: 'tag',
message: 'How should this pre-release version be tagged in npm?',
when: answers => !pkg.private && version.isPrereleaseOrIncrement(answers.version) && !options.tag,
when: answers => options.publish && !pkg.private && version.isPrereleaseOrIncrement(answers.version) && !options.tag,
choices: async () => {
const existingPrereleaseTags = await prereleaseTags(pkg.name);

Expand All @@ -118,7 +118,7 @@ module.exports = async (options, pkg) => {
type: 'input',
name: 'tag',
message: 'Tag',
when: answers => !pkg.private && version.isPrereleaseOrIncrement(answers.version) && !options.tag && !answers.tag,
when: answers => options.publish && !pkg.private && version.isPrereleaseOrIncrement(answers.version) && !options.tag && !answers.tag,
validate: input => {
if (input.length === 0) {
return 'Please specify a tag, for example, `next`.';
Expand Down

0 comments on commit 23524b5

Please sign in to comment.