ulwgl_run.py: always recreate the symlink

- Related to https://github.com/Open-Wine-Components/ULWGL-launcher/issues/27
This commit is contained in:
R1kaB3rN 2024-02-13 17:56:25 -08:00
parent 4f64389ec4
commit 4ba702565d
No known key found for this signature in database

View File

@ -44,11 +44,9 @@ example usage:
def setup_pfx(path: str) -> None:
"""Create a symlink to the WINE prefix and tracked_files file."""
if not (Path(path + "/pfx")).expanduser().is_symlink():
# When creating the symlink, we want it to be in expanded form when passed unexpanded paths
# Example: pfx -> /home/foo/.wine
# NOTE: When parsing a config file, an error can be raised if the prefix doesn't already exist
Path(path + "/pfx").expanduser().symlink_to(Path(path).expanduser())
if Path(path + "/pfx").expanduser().is_symlink():
Path(path + "/pfx").expanduser().unlink()
Path(path + "/pfx").expanduser().symlink_to(Path(path).expanduser())
Path(path + "/tracked_files").expanduser().touch()