-
Notifications
You must be signed in to change notification settings - Fork 44
refactor: ♻️ Ignore hidden directories #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
Conversation
KANAjetzt
left a comment
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.
ty and welcome 🥇
addons/mod_loader/mod_loader.gd
Outdated
| continue | ||
|
|
||
| # Ignore hidden directories | ||
| if mod_dir_name.begins_with("."): |
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.
While we're here, we can probably put these three together.
if (
not dir.current_is_dir() or
mod_dir_name.begins_with(".") or
mod_dir_name == ".."
):
continue|
Ive pushed a change for combining the three statements as said above. Moved the comments to be alongside them and have the operators at the start of the lines for clarity + diff reasons |
if (
not dir.current_is_dir() or
mod_dir_name.begins_with(".") or
mod_dir_name == ".."
):
continueLogically it makes sense, but after combining conditions isn't this check redundant? |
|
good point @aesereht |
|
Pushed another change to remove that last check |
KANAjetzt
left a comment
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.
Nice - ty 👍
Currently the mod loader will try to read hidden directories (such as .git) as if they were mods and then throw assertion errors. This just adds a small check to stop that