Skip to content

Commit

Permalink
Merge pull request #6 from rwjblue/refactor-promise-usage
Browse files Browse the repository at this point in the history
Leverage try/catch when bumping (to bubble unrelated errors)
  • Loading branch information
rwjblue authored Mar 25, 2020
2 parents 03565d6 + 7f143c6 commit 4eee960
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,16 @@ module.exports = class YarnWorkspacesPlugin extends UpstreamPlugin {
// intentionally not calling super.bump here

const task = () => {
return this.eachWorkspace(() => {
return this.exec(`npm version ${version} --no-git-tag-version`).catch((err) => {
return this.eachWorkspace(async () => {
try {
return this.exec(`npm version ${version} --no-git-tag-version`);
} catch (err) {
if (/version not changed/i.test(err)) {
this.log.warn(`Did not update version in package.json, etc. (already at ${version}).`);
} else {
throw err;
}
});
}
});
};

Expand Down

0 comments on commit 4eee960

Please sign in to comment.