-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Simplify mkdirP implementation #444
Conversation
(force pushed a lint fix) |
ping @damccorm, would you be able to review this? |
@hross could you take a look? |
I would also like to point out that while more code, the current code has been working in azure pipelines and github for 5 years+. changing the code can also introduce bugs and subtle behavioral differences ;). We should confirm 100% that the error case behaviors are the exact same. e.g. see the note about optimistic behaviors of the existing function. If needed, we should introduce more tests to prove the behaviors are the same in all cases. |
@thboop for thoughts. |
Fair point, although the built-in one have been shipped with every copy of Node.js since 2018, so it has probably been quite battle tested itself
Node's code also tries to mkdir the full path first, and then traverses up one step at a time:
I'd be happy to help with this if there is any specific behaviours that you think needs testing 👨💻 |
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.
LGTM thanks for the contribution! @LinusU
less code = fewer bugs☺️
The
recursive
option have been available since Node.js 10.12.0 (ref), and since GitHub Actions runs on Node.js 12.x this should always be available.