From 8672fcd2bbe6e1ad39172a5ad43b351091de69a1 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 29 Jan 2018 21:47:20 +0000 Subject: [PATCH] Fix authServer on Windows path Fixes #1588 --- .../storage/localfilesystem/projects/git/authServer.js | 2 +- .../storage/localfilesystem/projects/git/authWriter_spec.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/red/runtime/storage/localfilesystem/projects/git/authServer.js b/red/runtime/storage/localfilesystem/projects/git/authServer.js index d38ea9fd0..95b4eda0c 100644 --- a/red/runtime/storage/localfilesystem/projects/git/authServer.js +++ b/red/runtime/storage/localfilesystem/projects/git/authServer.js @@ -24,7 +24,7 @@ function getListenPath() { var fn = 'node-red-git-askpass-'+seed+'-sock'; var listenPath; if (process.platform === 'win32') { - listenPath = '\\\\.\\pipe\\'+getListenPath; + listenPath = '\\\\.\\pipe\\'+fn; } else { listenPath = path.join(process.env['XDG_RUNTIME_DIR'] || os.tmpdir(), fn); } diff --git a/test/red/runtime/storage/localfilesystem/projects/git/authWriter_spec.js b/test/red/runtime/storage/localfilesystem/projects/git/authWriter_spec.js index 71fb52a4e..a0b1ab5f5 100644 --- a/test/red/runtime/storage/localfilesystem/projects/git/authWriter_spec.js +++ b/test/red/runtime/storage/localfilesystem/projects/git/authWriter_spec.js @@ -29,7 +29,7 @@ function getListenPath() { var fn = 'node-red-git-askpass-'+seed+'-sock'; var listenPath; if (process.platform === 'win32') { - listenPath = '\\\\.\\pipe\\'+getListenPath; + listenPath = '\\\\.\\pipe\\'+fn; } else { listenPath = path.join(process.env['XDG_RUNTIME_DIR'] || os.tmpdir(), fn); } @@ -55,9 +55,10 @@ describe("localfilesystem/projects/git/authWriter", function() { var listenPath = getListenPath(); server.listen(listenPath, function(ready) { - child_process.exec(process.execPath+' "'+authWriter+'" "'+listenPath+'" TEST_PHRASE_FOO',{cwd:__dirname}, (error,stdout,stderr) => { + child_process.exec('"'+process.execPath+'" "'+authWriter+'" "'+listenPath+'" TEST_PHRASE_FOO',{cwd:__dirname}, (error,stdout,stderr) => { server.close(); try { + error.should.equal(0); receivedData.should.eql("TEST_PHRASE_FOO\n"); done(); } catch(err) {