mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(Launcher): fix dumpio bug (#2071)
This patch fixes `dumpio` launcher option. Fixes #2046
This commit is contained in:
committed by
Andrey Lushnikov
parent
ee7ebd6e17
commit
66887743ea
@@ -100,10 +100,9 @@ class Launcher {
|
||||
if (Array.isArray(options.args))
|
||||
chromeArguments.push(...options.args);
|
||||
|
||||
const stdio = options.dumpio ? ['inherit', 'inherit', 'inherit'] : ['pipe', 'pipe', 'pipe'];
|
||||
const stdio = ['pipe', 'pipe', 'pipe'];
|
||||
if (options.appMode)
|
||||
stdio.push('pipe', 'pipe');
|
||||
|
||||
const chromeProcess = childProcess.spawn(
|
||||
chromeExecutable,
|
||||
chromeArguments,
|
||||
@@ -114,6 +113,11 @@ class Launcher {
|
||||
}
|
||||
);
|
||||
|
||||
if (options.dumpio) {
|
||||
chromeProcess.stderr.pipe(process.stderr);
|
||||
chromeProcess.stdout.pipe(process.stdout);
|
||||
}
|
||||
|
||||
let chromeClosed = false;
|
||||
const waitForChromeToClose = new Promise((fulfill, reject) => {
|
||||
chromeProcess.once('close', () => {
|
||||
|
||||
Reference in New Issue
Block a user