Permalink
Browse files

fix the false_name test by altering data.name when it's not in a requ…

…irable location
  • Loading branch information...
1 parent aa68ef7 commit cbc3a0f7c07cdd8ff8d656d2927904699dacc2a0 @substack committed Jun 19, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/install.js
View
@@ -127,6 +127,14 @@ function install (args, cb_) {
, explicit: false
, parent: data
, wrap: null }
+
+ if (data.name !== path.basename(where) ||
+ path.basename(path.dirname(where)) !== 'node_modules') {
+ // there's a pkg.name, but it can't be required, so shim the name out
+ // to something unresolvable so the real deps will resolve
+ data.name = data.name + '_' + Math.random().toString(16).slice(2)
+ }
+
context.family[data.name] = context.ancestors[data.name] = data.version
installManyTop(deps.map(function (dep) {
var target = data.dependencies[dep]

0 comments on commit cbc3a0f

Please sign in to comment.