mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Merge pull request #386 from twitter/tmp-dir-cleanup
Use unsafeCleanup to clear temporary dirs, closes #345.
This commit is contained in:
@@ -431,7 +431,11 @@ Package.prototype.download = function () {
|
||||
src = url.parse(this.assetUrl);
|
||||
}
|
||||
|
||||
tmp.dir({ prefix: 'bower-' + this.name + '-', mode: parseInt('0777', 8) & (~process.umask()) }, function (err, tmpPath) {
|
||||
tmp.dir({
|
||||
prefix: 'bower-' + this.name + '-',
|
||||
mode: parseInt('0777', 8) & (~process.umask()),
|
||||
unsafeCleanup: true
|
||||
}, function (err, tmpPath) {
|
||||
if (err) return this.emit('error', err);
|
||||
|
||||
var req = src.protocol === 'https:' ? https : http;
|
||||
@@ -514,7 +518,10 @@ Package.prototype.extract = function () {
|
||||
Package.prototype.copy = function () {
|
||||
template('action', { name: 'copying', shizzle: this.path }).on('data', this.emit.bind(this, 'data'));
|
||||
|
||||
tmp.dir({ prefix: 'bower-' + this.name + '-' }, function (err, tmpPath) {
|
||||
tmp.dir({
|
||||
prefix: 'bower-' + this.name + '-',
|
||||
unsafeCleanup: true
|
||||
}, function (err, tmpPath) {
|
||||
if (err) return this.emit('error', err);
|
||||
|
||||
fs.stat(this.path, function (err, stats) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"node": ">=0.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tmp": "~0.0.16",
|
||||
"tmp": "~0.0.17",
|
||||
"glob": "~3.1.14",
|
||||
"nopt": "~2.0.0",
|
||||
"archy": "~0.0.2",
|
||||
|
||||
Reference in New Issue
Block a user