From cd2aabea60a5bdaf991aca843269da564f0d93f7 Mon Sep 17 00:00:00 2001 From: tretrauit Date: Wed, 28 Sep 2022 22:00:23 +0700 Subject: [PATCH] hack: workaround over Windows path --- worthless/installer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worthless/installer.py b/worthless/installer.py index 57c5cbf..a417f7e 100644 --- a/worthless/installer.py +++ b/worthless/installer.py @@ -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")