fix: Check SemanticReleaseError by error.semanticRelease property

This commit is contained in:
Pierre Vanduynslager
2017-10-29 14:37:05 -07:00
committed by Gregor Martynus
parent 8a1dd7b324
commit 65d344bae8
4 changed files with 43 additions and 5 deletions
+1 -2
View File
@@ -1,5 +1,4 @@
const program = require('commander');
const SemanticReleaseError = require('@semantic-release/error');
const logger = require('./lib/logger');
function list(values) {
@@ -49,7 +48,7 @@ module.exports = async () => {
} catch (err) {
// If error is a SemanticReleaseError then it's an expected exception case (no release to be done, running on a PR etc..) and the cli will return with 0
// Otherwise it's an unexpected error (configuration issue, code issue, plugin issue etc...) and the cli will return 1
if (err instanceof SemanticReleaseError) {
if (err.semanticRelease) {
logger.log(`%s ${err.message}`, err.code);
} else {
process.exitCode = 1;