diff options
author | Nicholas Bartlett <ntbartle@us.ibm.com> | 2014-11-10 23:34:04 +0300 |
---|---|---|
committer | Nicholas Bartlett <ntbartle@us.ibm.com> | 2014-11-10 23:34:04 +0300 |
commit | eda6bf0e0310b8a99e2b42b4fea110bb017d6354 (patch) | |
tree | 060d5495c126907aaed314dd31a441f1e8296af7 | |
parent | 34b397512cdaa11e70a8e82731a8a5d63613989f (diff) |
fixed stoponerror option not stopping grunt task
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | tasks/bootlint.js | 6 |
2 files changed, 2 insertions, 6 deletions
@@ -67,7 +67,7 @@ grunt.initConfig({ * Type: `Boolean` * Default: `false` -Breaks out of grunt task on first error. Use `--force` to force continue. +Breaks out of grunt task if there are errors. Use `--force` to force continue. #### options.relaxerror diff --git a/tasks/bootlint.js b/tasks/bootlint.js index 8338f79..131992e 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) { @@ -52,9 +51,6 @@ module.exports = function(grunt) { if (!output) { grunt.log.warn(filepath + ":", lintId, lint.message); totalErrCount++; - if (options.stoponerror) { - hardfail = true; - } } }; @@ -65,7 +61,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 (hardfail) { + if (options.stoponerror) { grunt.fail.warn('Too many bootlint errors.'); } } else { |