From 33d1502a1ba3f3a5088c83971c09fe616cabe808 Mon Sep 17 00:00:00 2001 From: Patrick Marsee Date: Sat, 20 Jul 2024 11:53:05 -0400 Subject: [PATCH] Fixed listing hidden folders as mods. --- seven_mods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seven_mods.py b/seven_mods.py index 394f421..2fc82cb 100755 --- a/seven_mods.py +++ b/seven_mods.py @@ -251,7 +251,7 @@ def get_loaded_mods(cfg: Config) -> list: ret = [] with os.scandir(internal_mods_path) as 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 ret.append(entry.name) return sorted(ret, key = lambda x: x.casefold()) @@ -260,7 +260,7 @@ def get_available_mods(cfg: Config) -> list: ret = [] with os.scandir(cfg.mods_dir) as 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) return sorted(ret, key = lambda x: x.casefold())