mirror of
https://github.com/aclist/dztui.git
synced 2026-11-19 00:02:04 +01:00
fix: return empty list if mod dir is missing
This commit is contained in:
1 parent
29223a8a1f
commit
5853e15b8e
2 files changed
+6
No files matched your search
@@ -35,6 +35,9 @@ def get_local_mod_path(steam_path: Path) -> Path:
|
||||
|
||||
|
||||
def get_local_mods(workshop_path: Path) -> list[Path]:
|
||||
# NOTE: user may not have staged mods before
|
||||
if workshop_path.is_dir() is False:
|
||||
return []
|
||||
mods = [file for file in workshop_path.iterdir() if file.is_dir()]
|
||||
return mods
|
||||
|
||||
@@ -123,6 +126,7 @@ def remove_stale_signatures(
|
||||
|
||||
path = lookup(config, Preferences.DEFAULT)
|
||||
steam_path = Path(path)
|
||||
|
||||
if ids is None:
|
||||
local_ids = get_local_mod_ids(steam_path)
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ def rebuild_symlinks(config: Path) -> None:
|
||||
expunge_link(file)
|
||||
|
||||
workshop = get_local_mod_path(steam_path)
|
||||
if workshop.is_dir() is False:
|
||||
return
|
||||
# NOTE: create symlinks for missing mods
|
||||
for mod_id in get_local_mod_ids(steam_path):
|
||||
uid = str(mod_id)
|
||||
|
||||
Reference in new issue
Block a user