Skip to content

Commit

Permalink
support spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
75lb committed Nov 1, 2024
1 parent 73779da commit 2723e4d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ class Explain extends JsdocCommand {

async _runJsdoc () {
const cmd = this.options.source.length
? `node ${this.jsdocPath} ${toSpawnArgs(this.jsdocOptions).join(' ')} -X ${this.tempFileSet.files.join(' ')}`
: `node ${this.jsdocPath} ${toSpawnArgs(this.jsdocOptions).join(' ')} -X ${this.inputFileSet.files.join(' ')}`;
? `node "${this.jsdocPath}" ${toSpawnArgs(this.jsdocOptions).join(' ')} -X ${this.tempFileSet.files.join(' ')}`
: `node "${this.jsdocPath}" ${toSpawnArgs(this.jsdocOptions).join(' ')} -X ${this.inputFileSet.files.join(' ')}`;

let jsdocOutput = { stdout: '', stderr: '' };
try {
Expand Down
4 changes: 2 additions & 2 deletions lib/explain.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class Explain extends JsdocCommand {

async _runJsdoc () {
const cmd = this.options.source.length
? `node ${this.jsdocPath} ${toSpawnArgs(this.jsdocOptions).join(' ')} -X ${this.tempFileSet.files.join(' ')}`
: `node ${this.jsdocPath} ${toSpawnArgs(this.jsdocOptions).join(' ')} -X ${this.inputFileSet.files.join(' ')}`
? `node "${this.jsdocPath}" ${toSpawnArgs(this.jsdocOptions).join(' ')} -X ${this.tempFileSet.files.join(' ')}`
: `node "${this.jsdocPath}" ${toSpawnArgs(this.jsdocOptions).join(' ')} -X ${this.inputFileSet.files.join(' ')}`

let jsdocOutput = { stdout: '', stderr: '' }
try {
Expand Down
7 changes: 7 additions & 0 deletions test/explain.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,11 @@ test.set('.explain({ files }): files is empty', async function () {
)
})

test.set('Spaces in jsdoc command path', async function () {
process.env.JSDOC_PATH = 'test/fixture/folder with spaces/jsdoc'
const f = new Fixture('class-all')
let output = await jsdoc.explain({ files: f.sourcePath })
a.ok(/a class with all of the things/.test(JSON.stringify(output)))
})

export { test, only, skip }

0 comments on commit 2723e4d

Please sign in to comment.