Skip to content

Commit 5e16b1c

Browse files
committed
fix: avoid printing yuidoc debug output when denali command is invoked with --debug
1 parent 82c329e commit 5e16b1c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/source-extracters/javascript.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as Y from 'yuidocjs';
21
import { forEach } from 'lodash';
32
import { dirSync as tmp } from 'tmp';
43
import { inspect } from 'util';
@@ -31,8 +30,15 @@ export default class JavascriptSourceExtracter extends SourceExtracter {
3130
paths,
3231
parseOnly: true
3332
};
33+
// Temporarily replace argv so YUIDoc doesn't try to print debug output
34+
// when --debug is passed to the command line for Denali
35+
let originalArgv = process.argv;
36+
process.argv = [];
37+
let Y = require('yuidocjs');
3438
let yuidoc = new Y.YUIDoc(config);
35-
return yuidoc.run();
39+
let results = yuidoc.run();
40+
process.argv = originalArgv;
41+
return results;
3642
}
3743

3844
normalize(yuidoc: YUIDoc.Project) {

0 commit comments

Comments
 (0)