diff --git a/scripts/release/publish-commands/confirm-version-and-tags.js b/scripts/release/publish-commands/confirm-version-and-tags.js index 73dadd5aaa661..2538f280a4774 100644 --- a/scripts/release/publish-commands/confirm-version-and-tags.js +++ b/scripts/release/publish-commands/confirm-version-and-tags.js @@ -11,15 +11,19 @@ const theme = require('../theme'); const run = async ({cwd, packages, tags}) => { clear(); - if (tags.length === 1) { + if (tags.length === 0) { console.log( - theme`{spinnerSuccess ✓} You are about the publish the following packages under the tag {tag ${tags}}` + theme`{spinnerSuccess ✓} You are about the publish the following packages without any tags:` + ); + } else if (tags.length === 1) { + console.log( + theme`{spinnerSuccess ✓} You are about the publish the following packages under the tag {tag ${tags}}:` ); } else { console.log( theme`{spinnerSuccess ✓} You are about the publish the following packages under the tags {tag ${tags.join( ', ' - )}}` + )}}:` ); } diff --git a/scripts/release/publish-commands/parse-params.js b/scripts/release/publish-commands/parse-params.js index b496d4f957fb4..34e60ff76783b 100644 --- a/scripts/release/publish-commands/parse-params.js +++ b/scripts/release/publish-commands/parse-params.js @@ -30,39 +30,10 @@ const paramDefinitions = [ module.exports = () => { const params = commandLineArgs(paramDefinitions); - - const {skipPackages, tags} = params; - - if (!tags || tags.length === 0) { - const usage = commandLineUsage([ - { - content: - 'Publishes the current contents of "build/node_modules" to NPM.', - }, - { - header: 'Options', - optionList: paramDefinitions, - }, - { - header: 'Examples', - content: [ - { - desc: 'Dry run test:', - example: '$ scripts/release/publish.js --dry --tags next', - }, - { - desc: 'Publish a new stable:', - example: '$ scripts/release/publish.js --tags next latest', - }, - ], - }, - ]); - console.log(usage); - process.exit(1); + if (!params.tags || !params.tags.length) { + params.tags = []; } - - splitCommaParams(skipPackages); - splitCommaParams(tags); - + splitCommaParams(params.skipPackages); + splitCommaParams(params.tags); return params; };