diff options
author | Zac Echola <zac.echola@so.mnscu.edu> | 2014-11-12 17:29:50 +0300 |
---|---|---|
committer | Zac Echola <zac.echola@so.mnscu.edu> | 2014-11-12 17:29:50 +0300 |
commit | 23fabe5e85bcd7a37ec0b95d1af6604d87dbf702 (patch) | |
tree | 7133de6808856f2cdcf7f303791548da6f724397 | |
parent | c3fd19090d44f8f33b3eb4de9631270bea483715 (diff) |
Revert "fixed stoponerror option not stopping grunt task"
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | tasks/bootlint.js | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -67,7 +67,7 @@ grunt.initConfig({ * Type: `Boolean` * Default: `false` -Breaks out of grunt task if there are errors. Use `--force` to force continue. +Breaks out of grunt task on first error. Use `--force` to force continue. #### options.relaxerror diff --git a/tasks/bootlint.js b/tasks/bootlint.js index 131992e..8338f79 100644 --- a/tasks/bootlint.js +++ b/tasks/bootlint.js @@ -21,6 +21,7 @@ module.exports = function(grunt) { var totalErrCount = 0; var totalFileCount = 0; + var hardfail = false; // Iterate over all specified file groups. this.files.forEach(function(f) { @@ -51,6 +52,9 @@ module.exports = function(grunt) { if (!output) { grunt.log.warn(filepath + ":", lintId, lint.message); totalErrCount++; + if (options.stoponerror) { + hardfail = true; + } } }; @@ -61,7 +65,7 @@ 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 (options.stoponerror) { + if (hardfail) { grunt.fail.warn('Too many bootlint errors.'); } } else { |