From 65d113b0079fa2570837f3cf95268ce24714a248 Mon Sep 17 00:00:00 2001 From: Kelly Campbell Date: Mon, 30 Apr 2018 15:36:30 -0400 Subject: [PATCH] CLI: Get node executable path from process.execPath (#1018) --- cli/pbts.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/pbts.js b/cli/pbts.js index d83504bfb..2c83fb2f1 100644 --- a/cli/pbts.js +++ b/cli/pbts.js @@ -98,7 +98,8 @@ exports.main = function(args, callback) { // There is no proper API for jsdoc, so this executes the CLI and pipes the output var basedir = path.join(__dirname, "."); var moduleName = argv.name || "null"; - var cmd = "node \"" + require.resolve("jsdoc/jsdoc.js") + "\" -c \"" + path.join(basedir, "lib", "tsd-jsdoc.json") + "\" -q \"module=" + encodeURIComponent(moduleName) + "&comments=" + Boolean(argv.comments) + "\" " + files.map(function(file) { return "\"" + file + "\""; }).join(" "); + var nodePath = process.execPath; + var cmd = nodePath + " \"" + require.resolve("jsdoc/jsdoc.js") + "\" -c \"" + path.join(basedir, "lib", "tsd-jsdoc.json") + "\" -q \"module=" + encodeURIComponent(moduleName) + "&comments=" + Boolean(argv.comments) + "\" " + files.map(function(file) { return "\"" + file + "\""; }).join(" "); var child = child_process.exec(cmd, { cwd: process.cwd(), argv0: "node",