From 6933a9e96a52728975d465506d8395ce2ad8c585 Mon Sep 17 00:00:00 2001 From: Zac Echola Date: Mon, 10 Nov 2014 15:55:55 -0600 Subject: fixing stoponerror --- tasks/bootlint.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'tasks') diff --git a/tasks/bootlint.js b/tasks/bootlint.js index 8338f79..abec81f 100644 --- a/tasks/bootlint.js +++ b/tasks/bootlint.js @@ -21,7 +21,6 @@ module.exports = function(grunt) { var totalErrCount = 0; var totalFileCount = 0; - var hardfail = false; // Iterate over all specified file groups. this.files.forEach(function(f) { @@ -48,13 +47,15 @@ module.exports = function(grunt) { totalErrCount++; output = true; }); + } if (!output) { grunt.log.warn(filepath + ":", lintId, lint.message); totalErrCount++; - if (options.stoponerror) { - hardfail = true; - } + } + + if (options.stoponerror) { + grunt.fail.warn('boom!'); } }; @@ -65,9 +66,6 @@ module.exports = function(grunt) { if (totalErrCount > 0) { grunt.log.writeln().fail(totalErrCount + " lint error(s) found across " + totalFileCount + " file(s)."); grunt.log.writeln().fail('For details, look up the lint problem IDs in the Bootlint wiki: https://github.com/twbs/bootlint/wiki'); - if (hardfail) { - grunt.fail.warn('Too many bootlint errors.'); - } } else { grunt.log.ok(totalFileCount + ' file(s) lint free.'); } -- cgit v1.2.3