Skip to content

Commit

Permalink
Fix incorrectly showing "Aborted!" message on successful publish (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinesedfan authored and sindresorhus committed Nov 30, 2019
1 parent 817a030 commit e53cbe8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ module.exports = async (input = 'patch', options) => {

// The default parameter is a workaround for https://github.com/Tapppi/async-exit-hook/issues/9
exitHook((callback = () => {}) => {
if (publishStatus === 'FAILED' && runPublish) {
if (publishStatus === 'FAILED') {
(async () => {
await rollback();
callback();
})();
} else if (publishStatus === 'SUCCESS' && runPublish) {
// Do nothing
} else if (publishStatus === 'SUCCESS') {
callback();
} else {
console.log('\nAborted!');
callback();
Expand Down Expand Up @@ -212,6 +212,8 @@ module.exports = async (input = 'patch', options) => {
}
]);
}
} else {
publishStatus = 'SUCCESS';
}

tasks.add({
Expand Down

0 comments on commit e53cbe8

Please sign in to comment.