-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
Invalid path error in windows #251
Comments
Perhaps you are passing in glob characters, like |
glob pattern was a great feature of rimraf. I miss it a lot. Wonder if there's a chance to get it back |
What was the intention to remove glob support? What alternative would you suggest? |
Unfortunately also our code is hard breaking since glob support was removed in version 4, especially because we also used it to spare some directories from deletion, using the |
Yeah, people seem to really miss it. It's a sad fact of open source that you mostly only hear from people when something bothers them, so over the years, I'd gotten the (perhaps mistaken!) impression that the automatic globbing was a big problem, because I only heard about it when it caused issues. But maybe now that it's removed, and I'm hearing about the issues that it causes to remove it. Life is funny that way. So yes, given the responses here, there is a chance to get it back, but I need to finish the rewrite of glob v9 first. It's mostly there, just have to work out a pathological performance issue. (Oops, I said "just". It might "just" require completely rethinking the v9 approach, but I think there's probably a clever way through it.) Once that's done, it'll have a much less dated API, more resilience in the face of various filesystem issues, and have speed on par with the other implementations that have been developed in the many years since node-glob was first written. In the meantime, you can use glob itself directly quite easily: // rimraf-glob.cjs
const glob = require('glob')
const rimraf = require('rimraf')
const rimrafWithGlob = async (pattern, rimrafOptions = {}, globOptions = {}) =>
new Promise((res, rej) => {
glob(pattern, globOptions, (err, results) => err ? rej(err) : res(rimraf(results, rimrafOptions)))
})
if (require.main === module) {
Promise.all(process.argv.slice(2).map(async (p) => rimrafWithGlob(p))
} |
Oh, and a bunch of tests are failing on Windows, so that's gonna have to be fixed, too. Feel free to follow along at: isaacs/node-glob#489 |
thanks for the effort isaacs |
Thanks for your effort too, I love and use this library for many years! :) |
@kai-dorschner-twinsity Just In the meantime, if you want to use it with globs, just Save that as Or, if you're using Bash version 4 or greater, you can add $ node -e 'console.log(process.argv.slice(1))' test/+(bin|readdir)*
[ 'test/bin.js', 'test/readdir-or-error.js' ] Of course, that'll probably never work on Powershell or cmd.exe, but installing glob and using your own script would work fine on any platform. |
dupe #249 |
Landed on 4.2.0 |
Perfect timing, thanks so much @isaacs! We are about to bump our deps atm. 💯 |
Keep in mind, you will have to add |
Duly noted, we anyways in most cases passed glob options in form of |
Yeah, passing |
Yes, just validated and all works as expected. Thanks again for following up to this one @isaacs! 👍 |
maybe a better error message? it doesn't obvious that "Error: Illegal characters in path." means I should set "{ glob: true }" |
- rimraf node_modules - isaacs/rimraf#251 (comment)
Rimraf has started to give me this error since I upgraded to the latest version. Any idea what could be happening?
The text was updated successfully, but these errors were encountered: