mirror of
https://github.com/tcsenpai/UWINE.git
synced 2025-06-06 19:45:20 +00:00
ulwgl_run.py: check dir before creating the symlink
- Setup can fail when creating the symlink if the pfx somehow exists already. One case this can probably happen is if the user references a Steam created prefix as the WINEPREFIX since pfx directory would exist.
This commit is contained in:
parent
4ba702565d
commit
3bb00480b9
11
ulwgl_run.py
11
ulwgl_run.py
@ -44,9 +44,14 @@ example usage:
|
||||
|
||||
def setup_pfx(path: str) -> None:
|
||||
"""Create a symlink to the WINE prefix and tracked_files file."""
|
||||
if Path(path + "/pfx").expanduser().is_symlink():
|
||||
Path(path + "/pfx").expanduser().unlink()
|
||||
Path(path + "/pfx").expanduser().symlink_to(Path(path).expanduser())
|
||||
pfx: Path = Path(path + "/pfx").expanduser()
|
||||
|
||||
if pfx.is_symlink():
|
||||
pfx.unlink()
|
||||
|
||||
if not pfx.is_dir():
|
||||
pfx.symlink_to(Path(path).expanduser())
|
||||
|
||||
Path(path + "/tracked_files").expanduser().touch()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user