Skip to content

Commit

Permalink
fix(task): fix flawed validation
Browse files Browse the repository at this point in the history
  • Loading branch information
eliranmal committed Sep 28, 2016
1 parent a0f1710 commit 6a252d8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tasks/sass-replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ module.exports = function (grunt) {
});

function validate(value, invalidMessage, validMessage) {
var result = !util.isEmpty(value);
if (result) {
grunt.fail.warn(invalidMessage);
} else if (validMessage) {
grunt.log.ok(validMessage);
var isValid = !util.isEmpty(value);
if (isValid) {
if (validMessage) {
grunt.log.ok(validMessage);
}
} else {
if (invalidMessage) {
grunt.fail.warn(invalidMessage);
}
}
return result;
return isValid;
}

};

0 comments on commit 6a252d8

Please sign in to comment.