Permalink
Browse files

Update master

  • Loading branch information...
1 parent a648982 commit bafe7366ca214881ec809204ccbd89969b5b49df @diervo diervo committed Jun 18, 2012
Showing with 4 additions and 16 deletions.
  1. +4 −16 lib/registry.js
View
@@ -56,32 +56,20 @@ Registry.prototype = {
if (options.tasks) {
this._loadTasks(options.tasks);
}
- if (options.npm) {
- this._loadExternalNPM(options.npm);
- }
},
_loadModule: function(name) {
this._loadDir(path.resolve('node_modules', name, 'lib'));
},
- _loadExternalNPM: function (dir) {
- dir = dir || path.join(process.cwd(),'node_modules');
- var fs = require('fs'),
- packages = fs.readdirSync(dir),
- self = this;
- packages.forEach(function (name) {
- self._loadModule(name);
- });
- },
_loadDir: function(dirname) {
- var fs = require('fs'),
- files = fs.readdirSync(dirname),
- self = this;
-
if (!path.existsSync(dirname)) {
throw new Error('Directory ' + dirname + ' doesn\'t exist');
}
+
+ var fs = require('fs'),
+ files = fs.readdirSync(dirname),
+ self = this;
files.forEach(function(filename) {
self._loadFile(path.join(dirname, filename));

0 comments on commit bafe736

Please sign in to comment.