fix: handle rm -rf * on Windows not matching files with shopt -u failglob#162
fix: handle rm -rf * on Windows not matching files with shopt -u failglob#162dsherret merged 6 commits intodenoland:mainfrom
rm -rf * on Windows not matching files with shopt -u failglob#162Conversation
|
$ shopt -s failglob
$ rm *.non-existent
-bash: no match: *.non-existentBasically the glob gets evaluated before reaching the I'm not sure what should be done here, but maybe we should support config with |
|
Hey @dsherret thanks for the reply! I wasn't aware that this is by design, and I do think that for the I would also say that it might be good to make failglob at least configurable (so we could decide in Pixi what we want). Happy to try a PR or extend this one if you want. |
rm -rf * on Windows with shopt -u failglob
rm -rf * on Windows with shopt -u failglobrm -rf * on Windows not matching files with shopt -u failglob
We had a user report that
rm -rf *.nonexistentfails even though-fshould just ignore non-existent files.Apparently it's related to how pattern expansion fails when not matching any files before it even reaches
rm. This changes the behavior to keep the original (literal) pattern if nothing matches and hands that torm.Written by Claude Code and tested against bash behavior.
Original issue: prefix-dev/pixi#3969