Permalink
Browse files

ignore node_modules/one

  • Loading branch information...
1 parent 6c247e1 commit 9fa375f1deb5fcd5066e19dba8a96a112ecf54d1 Azer Koculu committed Jan 30, 2012
@@ -0,0 +1 @@
+This package shouldn\'t have been included!
@@ -0,0 +1,5 @@
+{
+ "name":"one",
+ "version":"0.0.1",
+ "main":"index"
+}
@@ -4,6 +4,7 @@
"directories":{ "lib":"./lib" },
"dependencies":{
"dependency":"*",
- "sibling":"*"
+ "sibling":"*",
+ "one":"*"
}
}
View
@@ -12,6 +12,10 @@ var templating = require('./templating'),
server = require('./server'),
installDict = require('./install_dict');
+const DEPENDENCY_BLACK_LIST = [
+ 'one'
+];
+
var slice = Array.prototype.slice;
function build(options, callback){
@@ -34,33 +38,42 @@ function collectDeps(pkg, options, callback){
var deps = [],
declaredDepObj = pkg.manifest.dependencies,
- declaredDepList = declaredDepObj && Object.keys(declaredDepObj),
+ declaredDepList,
next;
+ if(declaredDepObj){
+ declaredDepList = Object.keys(declaredDepObj).filter(function(name){
+ return DEPENDENCY_BLACK_LIST.indexOf(name) == -1;
+ });
+ }
+
if(!declaredDepList || !declaredDepList.length){
return callback(undefined, deps);
}
- (function _(i){
+ (function iter(i){
if(i>=declaredDepList.length){
logging.debug('Loaded %d dependencies under the package "%s"',declaredDepList.length, pkg.manifest.name);
- return callback(undefined, deps);
+ callback(undefined, deps);
+ return;
}
- next = _.bind(null, i+1);
+ next = iter.bind(null, i+1);
var dp = declaredDepList[i],
manifestPath = path.join(pkg.wd, 'node_modules/', dp, '/package.json');
logging.debug('Loading the dependency in "'+manifestPath+'" for the package "'+pkg.name+'"');
if(pkg.pkgDict[dp]){
- return next();
+ next();
+ return;
}
loadPkgFromManifestPath(manifestPath, pkg, options, function(error, subpkg){
if(error){
- return callback(error);
+ callback(error);
+ return;
}
deps.push(subpkg);

0 comments on commit 9fa375f

Please sign in to comment.