Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
install: Track user requirement / existing as properties
Browse files Browse the repository at this point in the history
PR-URL: #8873
  • Loading branch information
iarna committed Jul 10, 2015
1 parent ea299c1 commit 8397552
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/install/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ var recalculateMetadata = exports.recalculateMetadata = function (tree, log, nex
chain([
[asyncMap, tomark, markDeps],
[asyncMap, tree.children, function (child, done) { recalculateMetadata(child, log, done) }]
], function () { next(null, tree) })
], function () {
tree.userRequired = tree.package._requiredBy.some(function (req) { req === '#USER' })
tree.existing = tree.package._requiredBy.some(function (req) { req === '#EXISTING' })
next(null, tree)
})
}

function addRequiredDep (tree, child) {
Expand Down
4 changes: 3 additions & 1 deletion lib/install/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ var defaultTemplate = {
missingDeps: {},
missingDevDeps: {},
path: null,
realpath: null
realpath: null,
userRequired: false,
existing: false
}

function isLink (node) {
Expand Down

0 comments on commit 8397552

Please sign in to comment.