-
Notifications
You must be signed in to change notification settings - Fork 30k
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
fs: add recursive option to rmdir() #29168
Conversation
FWIW, other than the docs and tests that need to be added, this looks good to me. |
Liking this as well, good call with the lazy loading. Waiting for docs/tests as well. Maybe some of the edge cases like the Windows ones can be included in the tests as well, but it's not a strict requirement. |
97b7a02
to
e293b5d
Compare
OK, this is ready for review. It occurred to me that we may want to mark this as experimental for a few releases. Any thoughts? |
CI: https://ci.nodejs.org/job/node-test-pull-request/25126/ EDIT: CI was yellow. |
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.
Having thought about rimraf
way too much over the last few months, I ultimately come around to liking the consistency that a recursive
option introduces (in relation to our implementation of mkdir recursive
)...
I think there's meat to the argument that this makes rmdir with an option combine both unlink
and rmdir
behavior, which is a bit weird, but I feel this is ultimately the better user experience.
We need to update license-builder.sh and re-run it? |
This commit adds a recursive option to fs.rmdir(), fs.rmdirSync(), and fs.promises.rmdir(). The implementation is a port of the npm module rimraf. PR-URL: #29168 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Landed in 53816cc |
Sorry i missed the PR; nobody posted a comment in #28208 indicating this one was opened. Does this mean that to feature detect this option, i have to try/catch around passing the wrong type of options object into the sync function? Am i missing a less invasive mechanism? |
Correct. It's the same with the |
This commit adds a recursive option to fs.rmdir(), fs.rmdirSync(), and fs.promises.rmdir(). The implementation is a port of the npm module rimraf. PR-URL: #29168 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Ben Coe <bencoe@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Notable changes: * deps: * Update npm to 6.10.3 (isaacs) #29023 * fs: * Add recursive option to rmdir() (cjihrig) #29168 * Allow passing true to emitClose option (Giorgos Ntemiris) #29212 * Add \*timeNs properties to BigInt Stats objects (Joyee Cheung) #21387 * net: * Allow reading data into a static buffer (Brian White) #25436 PR-URL: #29429
Notable changes: * deps: * Update npm to 6.10.3 (isaacs) #29023 * fs: * Add recursive option to rmdir() (cjihrig) #29168 * Allow passing true to emitClose option (Giorgos Ntemiris) #29212 * Add \*timeNs properties to BigInt Stats objects (Joyee Cheung) #21387 * net: * Allow reading data into a static buffer (Brian White) #25436 PR-URL: #29429
Notable changes: * deps: * Update npm to 6.10.3 (isaacs) #29023 * fs: * Add recursive option to rmdir() (cjihrig) #29168 * Allow passing true to emitClose option (Giorgos Ntemiris) #29212 * Add \*timeNs properties to BigInt Stats objects (Joyee Cheung) #21387 * net: * Allow reading data into a static buffer (Brian White) #25436 PR-URL: #29429
I guess |
Any chance of a backport to v10 for this (asking for sindresorhus/del#124)? |
10.x is in maintenance already so I think we missed the boat to do another
semver minor
…On Mon, May 11, 2020, 11:02 AM silverwind ***@***.***> wrote:
Any chance of a backport to v10 for this (asking for sindresorhus/del#124
<sindresorhus/del#124>)?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29168 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADZYV26DAS6E6RI276YBYTRRAHQXANCNFSM4IMMFUTA>
.
|
Fine with me. Agree it would be odd to add features like this so late in the cycle. |
This PR adds a
recursive
option tofs.rmdir()
,fs.rmdirSync()
, andfs.promises.rmdir()
. The implementation is a port of the npm modulerimraf
. I added an option tormdir()
to match the approach taken with core's recursivemkdir()
.This is my alternative to #28208 from #28208 (review).
I'm marking this PR as a work in progress, as I haven't added docs yet.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes