Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post publish using tag from the package version #5467

Merged
merged 1 commit into from
Feb 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tasks/sync_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var glob = require('glob');
var common = require('./util/common');
var constants = require('./util/constants');
var pkg = require('../package.json');
var rc = pkg.version.split('-')[1];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this error out if it's a non-RC version string like 2.0.1 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I don't think so. It was tested. In that case the tag and variable rc would be undefined.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh Javascript :) "string".split("-")[1] -> undefined ... ok then! I've been doing Python too long!

var tag = rc ? (' --tag ' + rc.split('.')[0]) : '';

var year = (new Date()).getFullYear();

Expand Down Expand Up @@ -306,6 +308,6 @@ function _publishToNPM(d, pkgPath) {
cb();
return;
}
exec('npm publish', {cwd: pkgPath}, cb).stdout.pipe(process.stdout);
exec('npm publish' + tag, {cwd: pkgPath}, cb).stdout.pipe(process.stdout);
};
}