rimraf: Wildcards not supported in v4 anymore
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
:
<Exec Command="npx rimraf ../../../docs/Packets/C*.md"></Exec>
Was this change intended? If yes, is my solution correct by specifying the version in the command like this?:
<Exec Command="npx rimraf@3.0.2 ../../../docs/Packets/C*.md"></Exec>
Thanks
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 6
- Comments: 16 (7 by maintainers)
Commits related to this issue
- Downgrade rimraf back to v3 v4 does not have wildcard support (see https://github.com/isaacs/rimraf/issues/249), which we make use of. — committed to chanzuckerberg/frontend-libs by ahuth a year ago
- fix: 回退rimraf — committed to 1zilc/fishing-funds by 1zilc a year ago
- rimraf removed support for globs temporarily. See https://github.com/isaacs/rimraf/issues/249 — committed to hildjj/editorconfig-core-js by hildjj a year ago
- treat paths as glob patterns when glob option set Fix: #249 — committed to isaacs/rimraf by isaacs a year ago
Ok, decided, I’ll bring back globs when glob v9 lands. https://github.com/isaacs/node-glob/pull/489
Glob v9 published, going to get on this soon.
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.
What was the reason for removing glob support? If it was because of dependency and security concerns, will there be glob support in the future built into the package?
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
So in my case I was able to fix the issue by just getting rid of the
/*
(which I didn’t need) and that fixed it, but it would have been more helpful if the error message would sayIllegal characters in path. Note that Globs are not supported
Landed on 4.2.0
thanks for considering reincorporating glob! It’s a very useful feature.
Yes perf, but also to keep it from being a breaking change from 4.1
changelog 420, I giggled
Yes, removing globs was intentional, as stated in the readme and changelog. You can specify the version as
rimraf@3
to avoid the semver major jump.