hack: workaround over Windows path

This commit is contained in:
tretrauit 2022-09-28 22:00:23 +07:00
parent 1830081cb0
commit cd2aabea60
Signed by: tretrauit
GPG Key ID: CDDE1C97EE305DAF
1 changed files with 5 additions and 2 deletions

View File

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