mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Removes tmp directory after copy, mimicing fs.rename
This commit is contained in:
@@ -127,6 +127,7 @@ Package.prototype.install = function () {
|
||||
if (err) return this.emit('error', err);
|
||||
return fs.rename(this.path, this.localPath, function (err) {
|
||||
if(err && err.code === 'EXDEV'){
|
||||
console.log(this.path);
|
||||
var reader = fstream.Reader(this.path).pipe(
|
||||
fstream.Writer({
|
||||
type: 'Directory',
|
||||
@@ -134,7 +135,11 @@ Package.prototype.install = function () {
|
||||
})
|
||||
);
|
||||
reader.on('error', this.emit.bind(this, 'error'));
|
||||
reader.on('end', this.cleanUpLocal.bind(this));
|
||||
reader.on('end', function(){
|
||||
rimraf(this.path,function(err){
|
||||
this.cleanUpLocal.bind(this);
|
||||
}.bind(this));
|
||||
}.bind(this));
|
||||
return;
|
||||
}
|
||||
this.cleanUpLocal();
|
||||
|
||||
Reference in New Issue
Block a user