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)
|
raise ValueError(err)
|
||||||
env["GAMEID"] = os.environ["GAMEID"]
|
env["GAMEID"] = os.environ["GAMEID"]
|
||||||
|
|
||||||
if (
|
if "WINEPREFIX" not in os.environ:
|
||||||
"WINEPREFIX" not in os.environ
|
pfx: Path = Path.home().joinpath("Games/ULWGL/" + env["GAMEID"])
|
||||||
or not Path(os.environ["WINEPREFIX"]).expanduser().is_dir()
|
pfx.mkdir(parents=True, exist_ok=True)
|
||||||
):
|
os.environ["WINEPREFIX"] = pfx.as_posix()
|
||||||
if "WINEPREFIX" not in os.environ:
|
if not Path(os.environ["WINEPREFIX"]).expanduser().is_dir():
|
||||||
# Automatically create a prefix for the user if WINEPREFIX is not set
|
pfx: Path = Path(os.environ["WINEPREFIX"])
|
||||||
# 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"])
|
|
||||||
|
|
||||||
pfx.mkdir(parents=True, exist_ok=True)
|
pfx.mkdir(parents=True, exist_ok=True)
|
||||||
os.environ["WINEPREFIX"] = pfx.as_posix()
|
os.environ["WINEPREFIX"] = pfx.as_posix()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user