mirror of
https://github.com/bower/bower.git
synced 2026-02-12 06:55:04 -05:00
Some more refactoring.
This commit is contained in:
@@ -26,8 +26,7 @@ GitFsResolver.prototype._resolveSelf = function () {
|
||||
|
||||
return this._copy()
|
||||
.then(this._fetch.bind(this))
|
||||
.then(this._findResolution.bind(this))
|
||||
.then(this._checkout.bind(this));
|
||||
.then(GitResolver.prototype._resolveSelf.bind(this));
|
||||
};
|
||||
|
||||
// -----------------
|
||||
|
||||
@@ -13,13 +13,6 @@ mout.object.mixIn(GitRemoteResolver, GitResolver);
|
||||
|
||||
// -----------------
|
||||
|
||||
GitRemoteResolver.prototype._resolveSelf = function () {
|
||||
this._sourcePath = this._source;
|
||||
|
||||
return this._findResolution()
|
||||
.then(this._checkout.bind(this));
|
||||
};
|
||||
|
||||
GitRemoteResolver.prototype._checkout = function (resolution) {
|
||||
var dir = this._tempDir,
|
||||
branch;
|
||||
|
||||
@@ -18,6 +18,11 @@ util.inherits(GitResolver, Resolver);
|
||||
|
||||
// -----------------
|
||||
|
||||
GitResolver.prototype._resolveSelf = function () {
|
||||
return this._findResolution()
|
||||
.then(this._checkout.bind(this));
|
||||
};
|
||||
|
||||
GitResolver.prototype.hasNew = function (oldTarget, oldResolution) {
|
||||
return this._findResolution()
|
||||
.then(function (resolution) {
|
||||
@@ -38,9 +43,16 @@ GitResolver.prototype.hasNew = function (oldTarget, oldResolution) {
|
||||
});
|
||||
};
|
||||
|
||||
// -----------------
|
||||
|
||||
// Abstract functions that should be implemented by concrete git resolvers
|
||||
GitResolver.prototype._checkout = function () {};
|
||||
GitResolver.fetchRefs = function (source) {};
|
||||
|
||||
// -----------------
|
||||
|
||||
GitResolver.prototype._findResolution = function () {
|
||||
var promise,
|
||||
branches,
|
||||
var branches,
|
||||
target,
|
||||
self = this.constructor;
|
||||
|
||||
@@ -89,11 +101,6 @@ GitResolver.prototype._findResolution = function () {
|
||||
|
||||
// ------------------------------
|
||||
|
||||
// Abstract function, should be implemented by concrete git resolvers
|
||||
GitResolver.fetchRefs = function (source) {};
|
||||
|
||||
// ------------------------------
|
||||
|
||||
GitResolver.fetchVersions = function (source) {
|
||||
if (this._versions && this._versions[source]) {
|
||||
return Q.resolve(this._versions[source]);
|
||||
|
||||
Reference in New Issue
Block a user