Skip to content

Commit

Permalink
warning message implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur-kushwaha committed Feb 1, 2018
1 parent d2fc3d0 commit cd62d04
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions lib/lifecycles/analyzeCommits.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,21 @@ module.exports = function () {
}).then(commits => {
return Promise.all(commits.map(check))
}).then(tasks => {
var failedTasks="";
for(var task of tasks){
if(task.report.valid==false){
for(var i in task.report.errors){
console.log(chalk.red((+i+1)+'.',task.report.errors[i].message));
}
console.log(chalk.blue(task.commit));
console.log(chalk.black('------------------------'));
}
for(var i in task.report.errors){
console.log(chalk.red('Error '+(+i+1)+'.',task.report.errors[i].message));
}
for(var i in task.report.warnings){
console.log(chalk.yellow('Warning '+(+i+1)+'.',task.report.warnings[i].message));
}
console.log(chalk.blue(task.commit));
console.log(chalk.black('------------------------'));
}

if(failedTasks.length>0){
if(task.report.errors.length){
return Promise.reject({
message:"ERRORS: Invalid commits"
})
});
}
});
}

0 comments on commit cd62d04

Please sign in to comment.