hack: workaround over Windows path

This commit is contained in:
tretrauit 2022-09-28 22:00:23 +07:00
parent 1830081cb0
commit cd2aabea60
No known key found for this signature in database
GPG Key ID: CDDE1C97EE305DAF

View File

@ -413,8 +413,11 @@ class Installer:
archive = Path(archive).resolve() archive = Path(archive).resolve()
if not archive.exists(): if not archive.exists():
raise FileNotFoundError(f"'{archive}' not found") raise FileNotFoundError(f"'{archive}' not found")
print(f'-o"{str(self._gamedir)}"') game_dir_str = str(self._gamedir)
proc = await asyncio.create_subprocess_shell(f"7z x {str(archive)} -o'{str(self._gamedir)}'") if not game_dir_str.endswith("/"):
game_dir_str += "/"
print(f'-o"{game_dir_str}"')
proc = await asyncio.create_subprocess_shell(f'7z x {str(archive)} -o"{game_dir_str}"')
await proc.wait() await proc.wait()
if proc.returncode != 0: if proc.returncode != 0:
raise RuntimeError("Extracting failed") raise RuntimeError("Extracting failed")