Skip to content

Commit efb816e

Browse files
authored
chore: fix commander truncating help output (microsoft#38930)
1 parent f28ac52 commit efb816e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

packages/playwright-core/src/utilsBundle.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ export type { Range as YAMLRange, Scalar as YAMLScalar, YAMLError, YAMLMap, YAML
3939
export type { Command } from '../bundles/utils/node_modules/commander';
4040
export type { EventEmitter as WebSocketEventEmitter, RawData as WebSocketRawData, WebSocket, WebSocketServer } from '../bundles/utils/node_modules/@types/ws';
4141

42+
program.exitOverride(err => {
43+
// Calling process.exit() might truncate large stdout/stderr output.
44+
// See https://github.com/nodejs/node/issues/6456.
45+
// See https://github.com/nodejs/node/issues/12921
46+
// eslint-disable-next-line no-restricted-properties
47+
process.stdout.write('', () => process.stderr.write('', () => process.exit(err.exitCode)));
48+
});
49+
4250
export function ms(ms: number): string {
4351
if (!isFinite(ms))
4452
return '-';

0 commit comments

Comments
 (0)