Fixed listing hidden folders as mods.

This commit is contained in:
Patrick Marsee 2024-07-20 11:53:05 -04:00
parent 7d0e3a20c2
commit 33d1502a1b

View file

@ -251,7 +251,7 @@ def get_loaded_mods(cfg: Config) -> list:
ret = [] ret = []
with os.scandir(internal_mods_path) as it: with os.scandir(internal_mods_path) as it:
for entry in it: for entry in it:
if entry.is_symlink() and entry.is_dir(): if entry.is_symlink() and entry.is_dir() and not entry.name.startswith('.'):
# only # only
ret.append(entry.name) ret.append(entry.name)
return sorted(ret, key = lambda x: x.casefold()) return sorted(ret, key = lambda x: x.casefold())
@ -260,7 +260,7 @@ def get_available_mods(cfg: Config) -> list:
ret = [] ret = []
with os.scandir(cfg.mods_dir) as it: with os.scandir(cfg.mods_dir) as it:
for entry in it: for entry in it:
if entry.is_dir() and entry.name != "__pycache__": if entry.is_dir() and not entry.name.startswith('.') and entry.name != "__pycache__":
ret.append(entry.name) ret.append(entry.name)
return sorted(ret, key = lambda x: x.casefold()) return sorted(ret, key = lambda x: x.casefold())