Permalink
Browse files

only load task when task name begin with grunt

  • Loading branch information...
1 parent ab4f4a1 commit 09daea43675e9cca393ee57e81343014e2dfc377 Hsiaoming Yang committed Mar 25, 2013
Showing with 4 additions and 2 deletions.
  1. +3 −1 lib/sdk/grunt.js
  2. +1 −1 package.json
View
@@ -94,7 +94,7 @@ grunt.loadGlobalTasks = function(name) {
process.exit(1);
}
- log.info('load', name + ' from NODE_PATH');
+ log.info('load', name);
var rootdir = path.join(NODE_PATH, name);
var pkgfile = path.join(rootdir, 'package.json');
@@ -105,6 +105,8 @@ grunt.loadGlobalTasks = function(name) {
if (pkg.keywords && pkg.keywords.indexOf('gruntcollection') !== -1) {
Object.keys(pkg.dependencies).forEach(function(depName) {
+ // global task name should begin with grunt
+ if (!/^grunt/.test(depName)) return;
var filepath = path.join(rootdir, 'node_modules', depName);
if (grunt.file.exists(filepath)) {
// Load this task plugin recursively
View
@@ -24,7 +24,7 @@
"lodash": "~0.9.2",
"grunt": "~0.4.1",
- "grunt-spm-build": "~0.2.0b1"
+ "grunt-spm-build": "~0.2.0b2"
},
"devDependencies": {
"sinon": "*",

0 comments on commit 09daea4

Please sign in to comment.