Not every notification was being extended properly.

Standardise variables.
This commit is contained in:
André Cruz
2013-06-01 02:10:58 +01:00
parent 41486d44ee
commit 2c9e4aacf2
2 changed files with 38 additions and 32 deletions

View File

@@ -109,6 +109,7 @@ Manager.prototype.install = function () {
id: 'install',
message: name + (release ? '#' + release : ''),
data: {
canonicalPkg: decEndpoint.canonicalPkg,
pkgMeta: decEndpoint.pkgMeta
}
}, decEndpoint));
@@ -116,7 +117,7 @@ Manager.prototype.install = function () {
// Remove existent and copy canonical package
dest = path.join(destDir, name);
promise = Q.nfcall(rimraf, dest)
.then(copy.copyDir.bind(copy, decEndpoint.dir, dest))
.then(copy.copyDir.bind(copy, decEndpoint.canonicalPkg, dest))
.fail(function (err) {
throw that._extendNotification(err, decEndpoint);
});
@@ -238,7 +239,7 @@ Manager.prototype._onFetch = function (deferred, decEndpoint, canonicalPkg, pkgM
// Store some needed stuff
decEndpoint.name = name = decEndpoint.name || pkgMeta.name;
decEndpoint.dir = canonicalPkg;
decEndpoint.canonicalPkg = canonicalPkg;
decEndpoint.pkgMeta = pkgMeta;
// Add to the resolved list, marking it as resolved
@@ -286,7 +287,7 @@ Manager.prototype._parseDependencies = function (decEndpoint, pkgMeta) {
// Simply mark it as resolved
if (compatible) {
childDecEndpoint.dir = compatible.dir;
childDecEndpoint.canonicalPkg = compatible.canonicalPkg;
childDecEndpoint.pkgMeta = compatible.pkgMeta;
this._resolved[key].push(childDecEndpoint);
return;
@@ -304,7 +305,7 @@ Manager.prototype._parseDependencies = function (decEndpoint, pkgMeta) {
// Wait for it to resolve and then add it to the resolved packages
if (compatible) {
childDecEndpoint = compatible.promise.then(function () {
childDecEndpoint.dir = compatible.dir;
childDecEndpoint.canonicalPkg = compatible.canonicalPkg;
childDecEndpoint.pkgMeta = compatible.pkgMeta;
this._resolved[key].push(childDecEndpoint);
}.bind(this));