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

fix(publishing-bumped-packages): look for status code instaead of stderr #36004

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions scripts/monorepo/find-and-publish-all-bumped-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ const findAndPublishAllBumpedPackages = () => {

const npmOTPFlag = NPM_CONFIG_OTP ? `--otp ${NPM_CONFIG_OTP}` : '';

const {stderr} = spawnSync('npm', ['publish', `${npmOTPFlag}`], {
const {status, stderr} = spawnSync('npm', ['publish', `${npmOTPFlag}`], {
cwd: packageAbsolutePath,
shell: true,
stdio: 'pipe',
encoding: 'utf-8',
});
if (stderr) {
if (status !== 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we maybe get back both stderr and status and if status is != 0 print both status and stderr? To get better understanding of what's failing 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can we maybe get back both stderr and status and if status is != 0 print both status and stderr? To get better understanding of what's failing 👍

Yeah, somehow missed that, will get it back

console.log(
`\u274c Failed to publish version ${nextVersion} of ${packageManifest.name}:`,
`\u274c Failed to publish version ${nextVersion} of ${packageManifest.name}. npm publish exited with code ${status}:`,
);
console.log(stderr);

Expand Down