-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make launcher.kill() synchronous, fs.rm now gets force
and maxRetries
#268
Conversation
src/chrome-launcher.ts
Outdated
// backwards support for node v12 + v14.14+ | ||
// https://nodejs.org/api/deprecations.html#DEP0147 | ||
const rmSync = this.fs.rmSync || this.fs.rmdirSync; | ||
rmSync(this.userDataDir, {recursive: true, force: true}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why set force: true now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this dir doesn't exist, we want this fn call to not throw.
// backwards support for node v12 + v14.14+ | ||
// https://nodejs.org/api/deprecations.html#DEP0147 | ||
const rmSync = this.fs.rmSync || this.fs.rmdirSync; | ||
rmSync(this.userDataDir, {recursive: true, force: true, maxRetries: 10}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also capture the force / max retry change in the commit title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops
force
and maxRetries
@paulirish would it make sense to remove the |
@calebeby yup sg! |
per #266 there's no reason for this to be async. keeping it async adds extra challenges to both debugging and understanding the flow.
also, added a function test for userdatadir removal
for review, turn off whitespace