Skip to content

Commit

Permalink
Close npm#961 install regression
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed May 22, 2011
1 parent 6fd9478 commit 6892acd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/install.js
Expand Up @@ -222,7 +222,7 @@ function prettify (tree) {
return Object.keys(tree).map(function (p) {
p = tree[p]
var c = ""
if (p.children) {
if (p.children && p.children.length) {
pref = "\n"
var l = p.children.pop()
c = p.children.map(function (c) {
Expand All @@ -249,6 +249,7 @@ function treeify (installed) {
, what = r[0]
l[where] = { parentDir: parentDir
, parent: parent
, children: []
, where: where
, what: what }
return l
Expand All @@ -262,9 +263,7 @@ function treeify (installed) {
l[r] = ww
} else {
var p = whatWhere[ww.parentDir]
p.children = p.children || []
p.children.push(ww)
//l[ww.parentDir] = whatWhere[ww.parentDir]
if (p) p.children.push(ww)
}
return l
}, {})
Expand Down

0 comments on commit 6892acd

Please sign in to comment.