Skip to content

Commit

Permalink
Dynamically resolve jsdoc when running pbts, fixes #622
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Jan 6, 2017
1 parent 69c04d7 commit c1de05f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cli/pbts.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ 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 jsdoc = path.join(path.dirname(require.resolve("jsdoc/package.json")), "jsdoc.js");
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 \"" + jsdoc + "\" -c \"" + 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",
Expand Down

0 comments on commit c1de05f

Please sign in to comment.