[Pkg-javascript-commits] [node-tmp] 01/04: Imported Upstream version 0.0.26

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sat May 16 16:06:02 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository node-tmp.

commit 5d3540078fdcde457128b7c1f4fd5a062699293b
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sat May 16 17:45:32 2015 +0200

    Imported Upstream version 0.0.26
---
 lib/tmp.js   | 27 ++++++---------------------
 package.json |  6 ++++--
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/lib/tmp.js b/lib/tmp.js
index b59ba34..b7c3044 100644
--- a/lib/tmp.js
+++ b/lib/tmp.js
@@ -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');
 
 
@@ -73,25 +73,6 @@ function _randomChars(howMany) {
 }
 
 /**
- * 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.
  *
  * @param {Object} obj
@@ -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);
   };
 }
 
diff --git a/package.json b/package.json
index 9b01e9b..ac42441 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name":        "tmp",
-  "version":     "0.0.25",
+  "version":     "0.0.26",
   "description": "Temporary file and directory creator",
   "author":      "KARASZI István <github at 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"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-tmp.git



More information about the Pkg-javascript-commits mailing list