mirror of
https://github.com/bower/bower.git
synced 2026-02-11 22:44:58 -05:00
Delete version from package meta if resolution is not a semver version.
This commit is contained in:
@@ -166,17 +166,24 @@ GitResolver.prototype._cleanup = function () {
|
||||
GitResolver.prototype._savePkgMeta = function (meta) {
|
||||
var deferred = Q.defer();
|
||||
|
||||
if (typeof meta.version === 'string' && meta.version !== this._resolution.version) {
|
||||
process.nextTick(function (metaVersion) {
|
||||
deferred.notify({
|
||||
type: 'warn',
|
||||
data: 'Version declared in the json (' + metaVersion + ') is different than the resolved one (' + this._resolution.version + ')'
|
||||
});
|
||||
}.bind(this, meta.version));
|
||||
}
|
||||
if (this._resolution.version) {
|
||||
// Warn if the package meta version is different than the resolved one
|
||||
if (typeof meta.version === 'string' && meta.version !== this._resolution.version) {
|
||||
process.nextTick(function (metaVersion) {
|
||||
deferred.notify({
|
||||
type: 'warn',
|
||||
data: 'Version declared in the json (' + metaVersion + ') is different than the resolved one (' + this._resolution.version + ')'
|
||||
});
|
||||
}.bind(this, meta.version));
|
||||
}
|
||||
|
||||
// Ensure that the version is fulfilled with the resolution version
|
||||
meta.version = this._resolution.version;
|
||||
// Ensure package meta version is the same as the resolution
|
||||
meta.version = this._resolution.version;
|
||||
} else {
|
||||
// If resolved to a target that is not a version,
|
||||
// remove the version from the meta
|
||||
delete meta.version;
|
||||
}
|
||||
|
||||
// Save resolution to be used in hasNew later
|
||||
meta._resolution = this._resolution;
|
||||
|
||||
Reference in New Issue
Block a user