mirror of
https://github.com/tcsenpai/UWINE.git
synced 2025-06-06 11:35:20 +00:00
ulwgl_run: update logic for non-existent WINEPREFIX
- Prefer having two separate branches for when the prefix doesn't exist or in the case it's not set
This commit is contained in:
parent
a610be41d8
commit
11bd213088
17
ulwgl_run.py
17
ulwgl_run.py
@ -124,17 +124,12 @@ def check_env(
|
||||
raise ValueError(err)
|
||||
env["GAMEID"] = os.environ["GAMEID"]
|
||||
|
||||
if (
|
||||
"WINEPREFIX" not in os.environ
|
||||
or not Path(os.environ["WINEPREFIX"]).expanduser().is_dir()
|
||||
):
|
||||
if "WINEPREFIX" not in os.environ:
|
||||
# Automatically create a prefix for the user if WINEPREFIX is not set
|
||||
# The GAMEID will be the name of the dir
|
||||
pfx: Path = Path.home().joinpath("Games/ULWGL/" + env["GAMEID"])
|
||||
else:
|
||||
pfx: Path = Path(os.environ["WINEPREFIX"])
|
||||
|
||||
if "WINEPREFIX" not in os.environ:
|
||||
pfx: Path = Path.home().joinpath("Games/ULWGL/" + env["GAMEID"])
|
||||
pfx.mkdir(parents=True, exist_ok=True)
|
||||
os.environ["WINEPREFIX"] = pfx.as_posix()
|
||||
if not Path(os.environ["WINEPREFIX"]).expanduser().is_dir():
|
||||
pfx: Path = Path(os.environ["WINEPREFIX"])
|
||||
pfx.mkdir(parents=True, exist_ok=True)
|
||||
os.environ["WINEPREFIX"] = pfx.as_posix()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user