feat: expunge ephemeral symlinks

This commit is contained in:
aclist 2026-06-13 03:36:59 +09:00
parent 513c445b24
commit 8b8c6268ab

View File

@ -16,12 +16,13 @@ def rebuild_symlinks(config: Path) -> None:
path = lookup(config, Preferences.DEFAULT)
steam_path = Path(path)
dayz_path = PeFile.get_nested_app_path(steam_path, APPID_DAYZ)
# NOTE: unlink stale symlinks
# TODO: expunge ephemeral (@C) links (possibility of name collisions)
# if str(file)[:2] == "@C": file.unlink()
for file in dayz_path.iterdir():
# NOTE: unlink stale symlinks
if file.is_symlink() and file.exists() is False:
file.unlink()
# NOTE: expunge ephemeral (custom) symlinks
if file.is_symlink() and str(file.stem)[:2] == "@C":
file.unlink()
workshop = get_local_mod_path(steam_path)
# NOTE: create symlinks for missing mods
for mod_id in get_local_mod_ids(steam_path):