From fe187dabd0e843a44b96717b5d31ada6a0732bec Mon Sep 17 00:00:00 2001 From: Laur Date: Thu, 4 May 2017 22:57:05 +0200 Subject: [PATCH 1/4] Fix paths with blanks on windows (nyc) Paths with blanks for the node command are note processed correctly (see nyc) --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d46f8d0..b4787f0 100644 --- a/index.js +++ b/index.js @@ -150,11 +150,15 @@ function mungeCmd (workingDir, options) { var m = command.match(re) var replace + var nodeCmd = workingDir + '/node.cmd' + if(workingDir.index(' ') !== -1) { + nodeCmd = ' "' + nodeCmd + '"' + } if (m) { options.originalNode = m[2] replace = m[1] + workingDir + '/node.cmd' + m[3] + m[4] options.args[cmdi + 1] = m[1] + m[2] + m[3] + - ' "' + workingDir + '\\node"' + m[4] + nodeCmd + m[4] } else { // XXX probably not a good idea to rewrite to the first npm in the // path if it's a full path to npm. And if it's not a full path to @@ -165,7 +169,7 @@ function mungeCmd (workingDir, options) { var npmPath = whichOrUndefined('npm') || 'npm' npmPath = path_.dirname(npmPath) + '\\node_modules\\npm\\bin\\npm-cli.js' - replace = m[1] + workingDir + '/node.cmd' + + replace = m[1] + nodeCmd + ' "' + npmPath + '"' + m[3] + m[4] options.args[cmdi + 1] = command.replace(npmre, replace) From f67ae964c52fc5e606b9a8327691e4eba118e692 Mon Sep 17 00:00:00 2001 From: Laur Date: Thu, 4 May 2017 22:58:30 +0200 Subject: [PATCH 2/4] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8c4c6d2..2c73230 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spawn-wrap", - "version": "1.3.4", + "version": "1.3.5", "description": "Wrap all spawned Node.js child processes by adding environs and arguments ahead of the main JavaScript file argument.", "main": "index.js", "dependencies": { From 6edd7148848c08d5816594975aca62990456a080 Mon Sep 17 00:00:00 2001 From: Laur Date: Thu, 4 May 2017 23:03:44 +0200 Subject: [PATCH 3/4] Typo --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b4787f0..4be80e4 100644 --- a/index.js +++ b/index.js @@ -151,7 +151,7 @@ function mungeCmd (workingDir, options) { var m = command.match(re) var replace var nodeCmd = workingDir + '/node.cmd' - if(workingDir.index(' ') !== -1) { + if(workingDir.indexOf(' ') !== -1) { nodeCmd = ' "' + nodeCmd + '"' } if (m) { From 19ec23d627c137d1fa00aa09f96edb890dabd528 Mon Sep 17 00:00:00 2001 From: Laur Date: Thu, 4 May 2017 23:04:45 +0200 Subject: [PATCH 4/4] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c73230..8105156 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spawn-wrap", - "version": "1.3.5", + "version": "1.3.5-a", "description": "Wrap all spawned Node.js child processes by adding environs and arguments ahead of the main JavaScript file argument.", "main": "index.js", "dependencies": {