diff --git a/index.js b/index.js index 065d74f71..84e62082f 100755 --- a/index.js +++ b/index.js @@ -16,7 +16,7 @@ module.exports = function standardVersion (argv) { return Promise.resolve() .then(()=>{ - return analyzeCommits(); + return args.skipAnalyze||analyzeCommits(); }) .then(() => { return bump(args, pkg) diff --git a/lib/lifecycles/analyzeCommits.js b/lib/lifecycles/analyzeCommits.js index 426500572..88fdbf99b 100644 --- a/lib/lifecycles/analyzeCommits.js +++ b/lib/lifecycles/analyzeCommits.js @@ -25,6 +25,7 @@ module.exports = function () { }).then(commits => { return Promise.all(commits.map(check)) }).then(tasks => { + var hasErrors=false; for(var task of tasks){ console.log(chalk.blue(task.commit)); for(var i in task.report.errors){ @@ -34,9 +35,11 @@ module.exports = function () { console.log(chalk.yellow('Warning '+(+i+1)+'.',task.report.warnings[i].message)); } console.log(chalk.black('------------------------')); + if(task.report.errors.length){ + hasErrors=true; + } } - - if(task.report.errors.length){ + if(hasErrors){ return Promise.reject({ message:"ERRORS: Invalid commits" });