Skip to content

Conversation

@Ategon
Copy link
Contributor

@Ategon Ategon commented May 26, 2023

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

Copy link
Member

@KANAjetzt KANAjetzt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty and welcome 🥇

continue

# Ignore hidden directories
if mod_dir_name.begins_with("."):
Copy link
Member

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

@KANAjetzt KANAjetzt added enhancement New feature or request refactor / cleanup Improves readability or maintainability labels Jun 5, 2023
@KANAjetzt KANAjetzt changed the title Ignore hidden directories refactor: ♻️ Ignore hidden directories Jun 5, 2023
@KANAjetzt KANAjetzt added this to the v6.0.0 milestone Jun 5, 2023
@Ategon
Copy link
Contributor Author

Ategon commented Jun 9, 2023

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

@aesereht
Copy link

aesereht commented Jun 9, 2023

if (
   not dir.current_is_dir() or
   mod_dir_name.begins_with(".") or
   mod_dir_name == ".."
):
   continue

Logically it makes sense, but after combining conditions isn't this check redundant? mod_dir_name == ".." as it should be already checked by mod_dir_name.begins_with(".").

@KANAjetzt
Copy link
Member

good point @aesereht

@Ategon
Copy link
Contributor Author

Ategon commented Jun 9, 2023

Pushed another change to remove that last check

Copy link
Member

@KANAjetzt KANAjetzt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - ty 👍

@KANAjetzt KANAjetzt added this pull request to the merge queue Jun 9, 2023
Merged via the queue into GodotModding:development with commit 284c058 Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor / cleanup Improves readability or maintainability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants