From 16c768c244bc804bbd4b3c3c5fc042c397abc194 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Thu, 8 Dec 2016 13:19:13 -0500 Subject: [PATCH] Check for nonexistent targets --- tasks/watch.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/watch.js b/tasks/watch.js index b18c78a..7a783d7 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -61,6 +61,10 @@ module.exports = function(grunt) { var self = this; var name = self.name || 'watch'; + if (!grunt.config.get([name, target])) { + return grunt.fail.fatal('Grunt ' + name + ' does not have a target called ' + target); + } + // Close any previously opened watchers watchers.forEach(function(watcher) { watcher.close();