Skip to content

Commit 6455cfa

Browse files
fix: add warning-filtering DocGen launcher
1 parent 9524e35 commit 6455cfa

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env node
2+
import path from 'node:path';
3+
import { spawn } from 'node:child_process';
4+
import { fileURLToPath } from 'node:url';
5+
6+
const here = path.dirname(fileURLToPath(import.meta.url));
7+
const main = path.join(here, 'docgen-v2.mjs');
8+
const child = spawn(process.execPath, ['--disable-warning=ExperimentalWarning', main, ...process.argv.slice(2)], {
9+
stdio: 'inherit',
10+
shell: false,
11+
windowsHide: true,
12+
env: process.env
13+
});
14+
15+
child.on('error', (error) => {
16+
console.error(`ERROR: failed to start DocGen: ${error.message}`);
17+
process.exitCode = 1;
18+
});
19+
child.on('exit', (code, signal) => {
20+
if (signal) process.kill(process.pid, signal);
21+
else process.exitCode = code ?? 1;
22+
});

0 commit comments

Comments
 (0)