-
-
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
Wildcards not supported in v4 anymore #249
Comments
Yes, removing globs was intentional, as stated in the readme and changelog. You can specify the version as |
What was the reason for removing glob support? |
I understand that it is communicated in the changelog and readme, but I would appreciate a motivation or workaround. I use rimraf exclusively for my cleanup tasks because it is the only way for me to make sure the globbing works on Windows as well as Linux. |
I'll add it to the bin in an upcoming minor version, perhaps restricted only to Windows systems since posix shells expand globs automatically, but having it automatically glob in the JS module opened the door for way too many complications and surprising bugs. I'm not concerned about the dependency or security, since I maintain node-glob, but most people really don't fully grok glob patterns, and find it very surprising when for example Another idea I'd had is to have a |
It might also be useful to change the error message, it took me some time to realize the glob patterns were removed on windows and the error message wasn't helping at all > rimraf packages/*/dist
Error: Illegal characters in path.
at pathArg (C:\GitHub\lerna-lite\node_modules\.pnpm\rimraf@4.1.1\node_modules\rimraf\dist\cjs\src\path-arg.js:46:33)
at X:\GitHub\lerna-lite\node_modules\.pnpm\rimraf@4.1.1\node_modules\rimraf\dist\cjs\src\index.js:39:66
at Array.map (<anonymous>)
.... So in my case I was able to fix the issue by just getting rid of the |
Ok, decided, I'll bring back globs when glob v9 lands. isaacs/node-glob#489 |
Thanks a lot @isaacs, listening to the community, especially in open source projects can be hard sometimes, as there are so many opinions to consider. Great to hear that a future version of rimraf will again support globs. Maybe two questions: a) Will you consider releasing the glob-enabled future version again as a major upgrade, because if so, I will now go for a workaround (as described in #251) for version 4., as soon as 5. is released with glob support re-added I will remove my workaround again. A major bump would help to clearly "signal" that glob support was re-added and the workaround can be removed. b) Do you think the glob support could be interface compatible with version 3 of the library? Including passing glob options into rimraf as |
a) it'll be a new feature, so a semver minor version bump. 4.2 or whatever. Unless some breaking change is required, which I don't anticipate. But the default npm b) the glob options will likely be different, as it's a semver major glob update, so it likely won't be entirely interface compatible with v3. In any event, I'm not going to bring back the callback api, so it will be a break from v3 for that reason anyway. But the bin behavior and the general flavor will be pretty close, I expect. |
Thanks @isaacs, so I know what to expect. Very helpful. Have a great rest of your day. |
thanks for considering reincorporating glob! It's a very useful feature. |
v4 does not have wildcard support (see isaacs/rimraf#249), which we make use of.
Glob v9 published, going to get on this soon. |
Landed on 4.2.0 |
@isaacs just to confirm, it looks like we now need to use a new flag > rimraf packages/**/*.tgz
Error: Illegal characters in path. however with --glob, it's all good > rimraf --glob packages/**/*.tgz
* Terminal will be reused by tasks, press any key to close it. That's the new direction to opt-in via |
changelog 420, I giggled |
Yes perf, but also to keep it from being a breaking change from 4.1 |
|
Hello,
Unfortunately, the recent update broke one of my builds.
I run rimraf in a C# project file with the following line, which should delete all markdown files beginning with
C
:Was this change intended?
If yes, is my solution correct by specifying the version in the command like this?:
Thanks
The text was updated successfully, but these errors were encountered: