From af6ca5b9a8d5c409e0ee09f904fbd6417b38d333 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:58:40 -0700 Subject: [PATCH] umu_proton: create symlink for all supported protons --- umu/umu_proton.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/umu/umu_proton.py b/umu/umu_proton.py index 465ca2247..6cf06d102 100644 --- a/umu/umu_proton.py +++ b/umu/umu_proton.py @@ -351,8 +351,6 @@ def _get_latest( def _update_proton( - proton: str, - steam_compat: Path, protons: list[Path], thread_pool: ThreadPoolExecutor, ) -> None: @@ -366,11 +364,8 @@ def _update_proton( will be removed, so users should not be storing important files there. """ futures: list[Future] = [] - steam_compat.joinpath("UMU-Latest").unlink(missing_ok=True) - steam_compat.joinpath("UMU-Latest").symlink_to(proton) log.debug("Updating UMU-Proton") log.debug("Previous builds: %s", protons) - log.debug("Linking UMU-Latest -> %s", proton) if not protons: return @@ -417,9 +412,7 @@ def _install_proton( for file in steam_compat.glob("*") if file.name.startswith(("UMU-Proton", "ULWGL-Proton")) ] - future = thread_pool.submit( - _update_proton, proton, steam_compat, protons, thread_pool - ) + future = thread_pool.submit(_update_proton, protons, thread_pool) # Move downloaded file from tmpfs to cache to avoid high memory usage log.debug("Moving: %s -> %s", archive_path, tmpdirs[1]) @@ -431,5 +424,9 @@ def _install_proton( log.console(f"'{proton_path}' -> '{steam_compat}'") move(proton_path, steam_compat) + steam_compat.joinpath("UMU-Latest").unlink(missing_ok=True) + steam_compat.joinpath("UMU-Latest").symlink_to(proton) + log.debug("Linking: UMU-Latest -> %s", proton) + if future: future.result()