-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
ignore files starting with . when loading folders #11214
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
ignore files starting with . when loading folders #11214
Conversation
I feel like we should add more customization for this. Maybe a custom regex filter or a whitelist/blacklist? |
Can we instead avoid panicking? It seems like the core problem here is that we're mis-parsing a folder as a file. |
Would this be fixed by #10153 ? That seems to be a more general solution. |
We could, but that's not the same. It's a standard behaviour to avoid dot files that are not yours, unless asked explicitly by the user. This is what this PR is doing.
In this case the issue is that we try to get the extension of a dot file and that doesn't work. #10153 could be a way to fix this, but I think this PR is about not going though dot files that should not be read anyway. |
This doesn't block loading dot files, it just doesn't load them when not trying specifically to, which is what most tools do by default |
I support this as a sane default (especially with how apple likes to litter dot files around the FS), but why make this change in |
I would love a .bevyignore for those cases. A simple gitignore-like file that has wildcards should be good enough. |
Agreed on
In the game I use asset server to load a whole folder. I have something akin to
If I could tell bevy which patterns to ignore that'd solve the two use cases above without having to change the loading logic which worked well for me so far. |
6c37f80
to
32c460e
Compare
Setting up some kind of configuration or a bevy ignore file is a bigger change that I'm not convinced I want. I updated the PR to filter in the file asset reader. This makes Bevy file listing standard with what most tools are doing. |
I just ran into this today. Would be lovely to see Bevy not try to load (and fail unrecoverably) the weird macOS |
|
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.
LGTM
@NthTensor @mockersf any chance this makes it into 0.16? |
We could, but I'd rather not tbh. This behavior could be unexpected, and merging unexpected behavior on the third release candidate has been bad before. I'd prefer to make sure we get some user reactions to this before it goes out. That's not a no, just my concerns. |
I had to try :P |
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.
Although this PR could be superseded by something more sophisticated like a .bevyignore
, I think that this is important enough to implement now. Without this PR there is basically a subtle incompatibility with macOS that someone developing an application on windows or linux may not notice until well into development.
Objective
Solution