1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix authServer on Windows path

Fixes #1588
This commit is contained in:
Nick O'Leary 2018-01-29 21:47:20 +00:00
parent 771e43583a
commit 8672fcd2bb
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 4 additions and 3 deletions

View File

@ -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);
}

View File

@ -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) {