npm-bump
npm-bump copied to clipboard
A better rollback when something fails
If anything throws in a process before we publish on npm, a full rollback should happen (including a push --force
on a branch to the previous version?)

Hey @mgol, it would definitely be nice to rollback when something fails.
Hmm, it should be enough to wrap https://github.com/mgol/npm-bump/blob/e665175404c767d7fc986ccdfcc64690831b0c67/lib/cli.js#L86-L89 in try-catch and do the rollback on error. Wrapping more things would be problematic as it npm publish
succeeded and next Git operations failed we can't revert the npm publish
(we could unpublish but you can't then re-publish the same version).
Thoughts? Would you like to prepare a PR?
Or maybe npm publish
should be moved to be the last operation so that we
always can fully rollback unless we finish all remote operations.
@mgol I agree, npm publish
should definitely be the last thing we do.