Skip to content

Commit

Permalink
fix(link): a package is a link if any of its ancestors is a link
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat authored and iarna committed May 26, 2017
1 parent 69c60ff commit 6632460
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ Installer.prototype.cloneCurrentTreeToIdealTree = function (cb) {
this.idealTree = copyTree(this.currentTree, (child) => {
// Filter out any children we didn't install ourselves. They need to be
// reinstalled in order for things to be correct.
return child.isTop || child.isLink || (
return child.isTop || isLink(child) || (
child.package &&
child.package._resolved &&
(child.package._integrity || child.package._shasum)
Expand All @@ -648,6 +648,10 @@ Installer.prototype.cloneCurrentTreeToIdealTree = function (cb) {
cb()
}

function isLink (child) {
return child.isLink || (child.parent && isLink(child.parent))
}

Installer.prototype.loadShrinkwrap = function (cb) {
validate('F', arguments)
log.silly('install', 'loadShrinkwrap')
Expand Down

0 comments on commit 6632460

Please sign in to comment.