Skip to content

Commit

Permalink
Close #45 PR: Fix requireResolution with not found task.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippsimon authored and sindresorhus committed Mar 1, 2016
1 parent 04ca4c8 commit cafd2a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ module.exports = function (grunt, opts) {

multimatch(names, pattern).forEach(function (pkgName) {
if (opts.requireResolution === true) {
grunt.loadTasks(resolvePkg(path.join(pkgName, 'tasks')));
try {
grunt.loadTasks(resolvePkg(path.join(pkgName, 'tasks')));
} catch (err) {
grunt.log.error('npm package "' + pkgName + '" not found. Is it installed?');
}
} else {
grunt.loadNpmTasks(pkgName);
}
Expand Down

0 comments on commit cafd2a4

Please sign in to comment.