Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update master

  • Loading branch information...
commit bafe7366ca214881ec809204ccbd89969b5b49df 1 parent a648982
@diervo diervo authored
Showing with 4 additions and 16 deletions.
  1. +4 −16 lib/registry.js
View
20 lib/registry.js
@@ -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));
Please sign in to comment.
Something went wrong with that request. Please try again.