Skip to content

Commit b341be2

Browse files
authored
custom userDataDir log file error
closeSync outFile and errFile when userDataDir is custom.
1 parent 30755cd commit b341be2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/chrome-launcher.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,6 @@ class Launcher {
405405

406406
destroyTmp() {
407407
return new Promise<void>(resolve => {
408-
// Only clean up the tmp dir if we created it.
409-
if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) {
410-
return resolve();
411-
}
412-
413408
if (this.outFile) {
414409
this.fs.closeSync(this.outFile);
415410
delete this.outFile;
@@ -419,6 +414,11 @@ class Launcher {
419414
this.fs.closeSync(this.errFile);
420415
delete this.errFile;
421416
}
417+
418+
// Only clean up the tmp dir if we created it.
419+
if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) {
420+
return resolve();
421+
}
422422

423423
// backwards support for node v12 + v14.14+
424424
// https://nodejs.org/api/deprecations.html#DEP0147

0 commit comments

Comments
 (0)