fix(restart): correctly prevent double npm publish run

This commit is contained in:
Stephan Bönnemann
2015-02-02 17:57:06 +01:00
parent f7faebb175
commit b39fecbdc2
3 changed files with 24 additions and 4 deletions
+8 -2
View File
@@ -43,7 +43,14 @@ if (~argv._.indexOf('pre')) {
}
console.log('Publishing v' + result)
if (publish) require('../src/restart')()
if (publish) require('../src/restart')(function (err) {
if (err) {
console.log('Something went wrong.')
throw err
}
process.exit(1)
})
})
})
}
@@ -59,7 +66,6 @@ if (~argv._.indexOf('post')) {
// see src/restart.js
if (~npmArgv.indexOf('--semantic-release-rerun')) {
console.log('Everything is alright :) npm will now print an error message that you can safely ignore.')
process.exit(1)
}
})
})