Skip to content

Commit

Permalink
fix: remove custom userDataDir error
Browse files Browse the repository at this point in the history
  • Loading branch information
Junyan committed Dec 9, 2021
1 parent 30755cd commit d87639f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/chrome-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,6 @@ class Launcher {

destroyTmp() {
return new Promise<void>(resolve => {
// Only clean up the tmp dir if we created it.
if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) {
return resolve();
}

if (this.outFile) {
this.fs.closeSync(this.outFile);
delete this.outFile;
Expand All @@ -419,6 +414,11 @@ class Launcher {
this.fs.closeSync(this.errFile);
delete this.errFile;
}

// Only clean up the tmp dir if we created it.
if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) {
return resolve();
}

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

0 comments on commit d87639f

Please sign in to comment.