mirror of
https://github.com/bower/bower.git
synced 2026-02-11 14:34:58 -05:00
Guess name from the source in the GitResolver.
This commit is contained in:
@@ -10,6 +10,11 @@ var createError = require('../../util/createError');
|
||||
|
||||
var GitResolver = function (source, options) {
|
||||
Resolver.call(this, source, options);
|
||||
|
||||
// Guess the name
|
||||
if (this._guessedName) {
|
||||
this._name = path.basename(this._source, '.git');
|
||||
}
|
||||
};
|
||||
|
||||
util.inherits(GitResolver, Resolver);
|
||||
@@ -138,6 +143,12 @@ GitResolver.prototype._cleanup = function () {
|
||||
};
|
||||
|
||||
GitResolver.prototype._savePkgMeta = function (meta) {
|
||||
// Ensure that the .version is fulfilled with the resolution
|
||||
// version if any
|
||||
// TODO: emit a warning if the json version is different than the resolved one
|
||||
// also add a test for this stuff
|
||||
meta.version = this._resolution.version;
|
||||
|
||||
// Save resolution to be used in hasNew later
|
||||
meta._resolution = this._resolution;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user