From 33bd82851aba4106851523cd952511ead0057da2 Mon Sep 17 00:00:00 2001 From: GloriousEggroll Date: Mon, 19 Feb 2024 14:30:20 -0700 Subject: [PATCH] allow using shortname of proton version as alternative to full file path --- ulwgl_run.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ulwgl_run.py b/ulwgl_run.py index d744c39..605c6d2 100755 --- a/ulwgl_run.py +++ b/ulwgl_run.py @@ -116,16 +116,19 @@ def check_env( raise ValueError(err) env["GAMEID"] = os.environ["GAMEID"] - if ( - "PROTONPATH" not in os.environ - or not Path(os.environ["PROTONPATH"]).expanduser().is_dir() - ): - # Attempt to auto set this env var for the user + if "PROTONPATH" not in os.environ: + os.environ["PROTONPATH"] = "" + get_ulwgl_proton(env) + elif Path("~/.local/share/Steam/compatibilitytools.d/" + os.environ["PROTONPATH"]).expanduser().is_dir(): + env["PROTONPATH"] = Path("~/.local/share/Steam/compatibilitytools.d/").expanduser().joinpath(os.environ["PROTONPATH"]) + elif not Path(os.environ["PROTONPATH"]).expanduser().is_dir(): os.environ["PROTONPATH"] = "" get_ulwgl_proton(env) else: env["PROTONPATH"] = os.environ["PROTONPATH"] + print(env["PROTONPATH"]) + # If download fails/doesn't exist in the system, raise an error if not os.environ["PROTONPATH"]: err: str = "Download failed.\nProton could not be found in cache or compatibilitytools.d\nPlease set $PROTONPATH or visit https://github.com/Open-Wine-Components/ULWGL-Proton/releases"