Skip to content

Commit

Permalink
Allow publishing untagged releases
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Jul 31, 2020
1 parent 3d08955 commit 44a5106
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 36 deletions.
10 changes: 7 additions & 3 deletions scripts/release/publish-commands/confirm-version-and-tags.js
Expand Up @@ -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(
', '
)}}`
)}}:`
);
}

Expand Down
37 changes: 4 additions & 33 deletions scripts/release/publish-commands/parse-params.js
Expand Up @@ -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;
};

0 comments on commit 44a5106

Please sign in to comment.