From 57b1653a374d83d1d831ca0abb9bb0fa44b0e14a Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 14 Apr 2020 08:15:16 +0800 Subject: [PATCH] MDL-68405 js: Ensure correct exit code for gherkinlint --- Gruntfile.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index bd3918574e2..59ebfbbbaf1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -536,12 +536,8 @@ module.exports = function(grunt) { formatter.printResults(results); // Report on the results. - // We exit 1 if there is at least one error, otherwise we exit cleanly. - if (results.some(result => result.errors.length > 0)) { - done(1); - } else { - done(0); - } + // The done function takes a bool whereby a falsey statement causes the task to fail. + done(results.every(result => result.errors.length === 0)); }; tasks.startup = function() {