[Pkg-javascript-commits] [node-parents] 14/29: fix for network drives on windows

Bastien Roucariès rouca at moszumanska.debian.org
Sun Aug 20 13:47:04 UTC 2017


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

rouca pushed a commit to branch master
in repository node-parents.

commit df83114df4cef91db480226095cb3a7a40ff327d
Author: James Halliday <mail at substack.net>
Date:   Mon Dec 2 10:04:36 2013 -0800

    fix for network drives on windows
---
 index.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 13908a5..2bbfe4d 100644
--- a/index.js
+++ b/index.js
@@ -10,7 +10,7 @@ module.exports = function (cwd, opts) {
     var init = isWindows ? '' : '/';
     
     var join = function (x, y) {
-        var ps = [].slice.call(arguments).filter(function (p) {
+        var ps = [ x, y ].filter(function (p) {
             return p && typeof p === 'string'
         });
         return path.normalize(ps.join(isWindows ? '\\' : '/'));
@@ -25,5 +25,10 @@ module.exports = function (cwd, opts) {
         .reverse()
     ;
     if (res[0] === res[1]) return [ res[0] ];
+    if (isWindows && /^\\/.test(cwd)) {
+        return res.slice(0,-1).map(function (d) {
+            return d.replace(/^\./, '');
+        });
+    }
     return res;
 }

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



More information about the Pkg-javascript-commits mailing list