Commit 5d354007 authored by Bas Couwenberg's avatar Bas Couwenberg

Imported Upstream version 0.0.26

parent d1460f9f
......@@ -16,7 +16,7 @@ var
crypto = require('crypto'),
exists = fs.exists || path.exists,
existsSync = fs.existsSync || path.existsSync,
tmpDir = os.tmpDir || _getTMPDir,
tmpDir = require('os-tmpdir'),
_c = require('constants');
......@@ -72,25 +72,6 @@ function _randomChars(howMany) {
return value.join('');
}
/**
* Gets the temp directory.
*
* @return {String}
* @api private
*/
function _getTMPDir() {
var tmpNames = ['TMPDIR', 'TMP', 'TEMP'];
for (var i = 0, length = tmpNames.length; i < length; i++) {
if (_isUndefined(process.env[tmpNames[i]])) continue;
return process.env[tmpNames[i]];
}
// fallback to the default
return '/tmp';
}
/**
* Checks whether the `obj` parameter is defined or not.
*
......@@ -410,9 +391,13 @@ function _prepareRemoveCallback(removeFunction, arg) {
return function _cleanupCallback() {
if (called) return;
removeFunction(arg);
var index = _removeObjects.indexOf(removeFunction);
if (index >= 0) {
_removeObjects.splice(index, 1);
}
called = true;
removeFunction(arg);
};
}
......
{
"name": "tmp",
"version": "0.0.25",
"version": "0.0.26",
"description": "Temporary file and directory creator",
"author": "KARASZI István <github@spam.raszi.hu> (http://raszi.hu/)",
......@@ -33,7 +33,9 @@
"node": ">=0.4.0"
},
"dependencies": {},
"dependencies": {
"os-tmpdir": "~1.0.0"
},
"devDependencies": {
"vows": "~0.7.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment