From 26d68e36e438b590589e5beaec418c63b8f939cf Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Fri, 6 Jan 2017 02:57:53 +0100 Subject: [PATCH] Dynamically resolve jsdoc when running pbts, fixes #622 --- cli/pbts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/pbts.js b/cli/pbts.js index 41c0fc0aa..66bac6c46 100644 --- a/cli/pbts.js +++ b/cli/pbts.js @@ -97,7 +97,7 @@ 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 \"" + basedir + "/node_modules/jsdoc/jsdoc.js\" -c \"" + basedir + "/jsdoc.types.json\" -q \"module=" + encodeURIComponent(moduleName) + "&comments=" + Boolean(argv.comments) + "\" " + files.map(function(file) { return '"' + file + '"'; }).join(' '); + var cmd = "node \"" + require.resolve("jsdoc/jsdoc.js") + "\" -c \"" + path.join(basedir, "jsdoc.types.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",