mirror of
https://github.com/bower/bower.git
synced 2026-02-11 22:44:58 -05:00
Initial take on the commands + renderers + cli.
This commit is contained in:
@@ -40,18 +40,30 @@ GitResolver.prototype._hasNew = function (canonicalPkg, pkgMeta) {
|
||||
GitResolver.prototype._resolve = function () {
|
||||
var deferred = Q.defer();
|
||||
|
||||
deferred.notify({ type: 'action', data: 'Finding resolution' });
|
||||
deferred.notify({
|
||||
level: 'action',
|
||||
tag: 'versions',
|
||||
data: 'Finding resolution'
|
||||
});
|
||||
|
||||
this._findResolution()
|
||||
.then(function (resolution) {
|
||||
deferred.notify({ type: 'action', data: 'Checking out "' + (resolution.tag || resolution.branch || resolution.commit) + '"' });
|
||||
deferred.notify({
|
||||
level: 'action',
|
||||
tag: 'checkout',
|
||||
data: 'Checking out "' + (resolution.tag || resolution.branch || resolution.commit) + '"'
|
||||
});
|
||||
|
||||
return this._checkout()
|
||||
// Always run cleanup after checkout to ensure that .git is removed!
|
||||
// If it's not removed, problems might arise when the "tmp" module attempts
|
||||
// to delete the temporary folder
|
||||
.fin(function () {
|
||||
deferred.notify({ type: 'action', data: 'Cleaning up' });
|
||||
deferred.notify({
|
||||
level: 'action',
|
||||
tag: 'cleanup',
|
||||
data: 'Cleaning up git artifacts'
|
||||
});
|
||||
return this._cleanup();
|
||||
}.bind(this));
|
||||
}.bind(this))
|
||||
@@ -179,7 +191,8 @@ GitResolver.prototype._savePkgMeta = function (meta) {
|
||||
if (typeof meta.version === 'string' && semver.neq(meta.version, version)) {
|
||||
process.nextTick(function (metaVersion) {
|
||||
deferred.notify({
|
||||
type: 'warn',
|
||||
level: 'warn',
|
||||
tag: 'mismatch',
|
||||
data: 'Version declared in the json (' + metaVersion + ') is different than the resolved one (' + version + ')'
|
||||
});
|
||||
}.bind(this, meta.version));
|
||||
@@ -194,7 +207,7 @@ GitResolver.prototype._savePkgMeta = function (meta) {
|
||||
}
|
||||
|
||||
// Save version/commit/branch/tag in the release
|
||||
meta._release = version || this._resolution.tag || this._resolution.commit;
|
||||
meta._release = version || this._resolution.tag || this._resolution.commit.substr(0, 10);
|
||||
|
||||
// Save resolution to be used in hasNew later
|
||||
meta._resolution = this._resolution;
|
||||
|
||||
@@ -155,7 +155,9 @@ Resolver.prototype._readJson = function (dir) {
|
||||
// If it is a component.json, warn about the deprecation
|
||||
if (path.basename(filename) === 'component.json') {
|
||||
deferred.notify({
|
||||
type: 'warn',
|
||||
level: 'warn',
|
||||
tag: 'deprecated',
|
||||
json: filename,
|
||||
data: 'Package "' + this._name + '" is using the deprecated component.json file'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ UrlResolver.prototype._savePkgMeta = function (meta) {
|
||||
|
||||
// Store ETAG under _release
|
||||
if (meta._cacheHeaders.ETag) {
|
||||
meta._release = 'e-tag: ' + mout.string.trim(meta._cacheHeaders.ETag, '"');
|
||||
meta._release = 'e-tag:' + mout.string.trim(meta._cacheHeaders.ETag.substr(0, 10), '"');
|
||||
}
|
||||
|
||||
// Store main if is a single file
|
||||
|
||||
Reference in New Issue
Block a user