Skip to content

Commit

Permalink
Merge pull request #1393 from mansona/allow-redeploy-npm
Browse files Browse the repository at this point in the history
continue deploying unstable packages even with an error
  • Loading branch information
ef4 authored Apr 11, 2023
2 parents a993025 + 83d2496 commit bae3467
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test-packages/unstable-release/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module.exports = {
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
env: {
browser: true,
browser: false,
node: true,
},
overrides: [
// node files
Expand Down
18 changes: 17 additions & 1 deletion test-packages/unstable-release/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,25 @@ import { dirname } from 'path';
async function publish() {
let publicWorkspaces = await listPublicWorkspaces();

const errors = [];

for (let workspace of publicWorkspaces) {
console.info(`Publishing ${workspace}`);
await execaCommand('npm publish --tag=unstable --verbose', { cwd: dirname(workspace) });
try {
await execaCommand('npm publish --tag=unstable --verbose', { cwd: dirname(workspace) });
} catch (err) {
console.info(`Publishing ${workspace} has failed. A full list of errors will be printed at the end of this run`);
errors.push(err);
continue;
}

console.info(`Publishing ${workspace} completed successfully!`);
}

if (errors.length) {
console.error('Errors were encountered while publishing these packages');
errors.forEach(error => console.log(error.stderr));
process.exit(1);
}
}

Expand Down

0 comments on commit bae3467

Please sign in to comment.