mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Fix update for asset packages.
This commit is contained in:
@@ -150,8 +150,7 @@ Package.prototype.lookup = function () {
|
||||
};
|
||||
|
||||
Package.prototype.install = function () {
|
||||
// Only print the installing action if this package has been resolved
|
||||
if (this.version) template('action', { name: 'installing', shizzle: this.name + (this.version ? '#' + this.version : '') })
|
||||
template('action', { name: 'installing', shizzle: this.name + (this.version ? '#' + this.version : '') })
|
||||
.on('data', this.emit.bind(this, 'data'));
|
||||
|
||||
if (path.resolve(this.path) == this.localPath) {
|
||||
@@ -190,7 +189,7 @@ Package.prototype.cleanUpLocal = function () {
|
||||
else delete this.json.commit;
|
||||
|
||||
if (this.gitUrl) this.json.repository = { type: "git", url: this.gitUrl };
|
||||
if (this.assetUrl) this.json = this.generateAssetJSON();
|
||||
else if (this.assetUrl) this.json = this.generateAssetJSON();
|
||||
|
||||
var jsonStr = JSON.stringify(this.json, null, 2);
|
||||
fs.writeFile(path.join(this.localPath, config.json), jsonStr);
|
||||
@@ -526,12 +525,15 @@ Package.prototype.fetch = function () {
|
||||
};
|
||||
|
||||
Package.prototype.fetchURL = function () {
|
||||
if (this.json.repository && this.json.repository.type == 'git') {
|
||||
if (!this.json.repository) return this.emit('fetchURL');
|
||||
|
||||
if (this.json.repository.type == 'git') {
|
||||
this.gitUrl = this.json.repository.url;
|
||||
this.generateResourceId();
|
||||
this.emit('fetchURL', this.gitUrl);
|
||||
this.emit('fetchURL', this.gitUrl, 'git');
|
||||
} else {
|
||||
this.emit('error', new Error('No git url found for ' + this.name));
|
||||
this.assetUrl = this.json.repository.url;
|
||||
this.emit('fetchURL', this.assetUrl, 'asset');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user