Skip to content

Commit 2723e4d

Browse files
committed
support spaces
1 parent 73779da commit 2723e4d

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

dist/index.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ class Explain extends JsdocCommand {
121121

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

127127
let jsdocOutput = { stdout: '', stderr: '' };
128128
try {

lib/explain.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class Explain extends JsdocCommand {
2424

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

3030
let jsdocOutput = { stdout: '', stderr: '' }
3131
try {

test/explain.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,11 @@ test.set('.explain({ files }): files is empty', async function () {
4949
)
5050
})
5151

52+
test.set('Spaces in jsdoc command path', async function () {
53+
process.env.JSDOC_PATH = 'test/fixture/folder with spaces/jsdoc'
54+
const f = new Fixture('class-all')
55+
let output = await jsdoc.explain({ files: f.sourcePath })
56+
a.ok(/a class with all of the things/.test(JSON.stringify(output)))
57+
})
58+
5259
export { test, only, skip }

0 commit comments

Comments
 (0)