updater: remove directory in deletefiles.txt too
This commit is contained in:
parent
abdf19bc16
commit
0b51be1649
2
setup.py
2
setup.py
@ -9,7 +9,7 @@ README = (HERE / "README.md").read_text()
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='worthless',
|
name='worthless',
|
||||||
version='2.2.5',
|
version='2.2.6',
|
||||||
packages=['worthless', 'worthless.classes', 'worthless.classes.launcher', 'worthless.classes.installer'],
|
packages=['worthless', 'worthless.classes', 'worthless.classes.launcher', 'worthless.classes.installer'],
|
||||||
url='https://git.froggi.es/tretrauit/worthless-launcher',
|
url='https://git.froggi.es/tretrauit/worthless-launcher',
|
||||||
license='MIT License',
|
license='MIT License',
|
||||||
|
@ -391,6 +391,9 @@ class Installer:
|
|||||||
continue
|
continue
|
||||||
if current_game_file.is_file():
|
if current_game_file.is_file():
|
||||||
current_game_file.unlink(missing_ok=True)
|
current_game_file.unlink(missing_ok=True)
|
||||||
|
continue
|
||||||
|
if current_game_file.is_dir():
|
||||||
|
shutil.rmtree(current_game_file, ignore_errors=True)
|
||||||
|
|
||||||
await asyncio.to_thread(archive.extractall, self._gamedir, members=files)
|
await asyncio.to_thread(archive.extractall, self._gamedir, members=files)
|
||||||
archive.close()
|
archive.close()
|
||||||
@ -426,14 +429,6 @@ 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")
|
||||||
# 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")
|
|
||||||
with zipfile.ZipFile(archive, 'r') as f:
|
with zipfile.ZipFile(archive, 'r') as f:
|
||||||
await asyncio.to_thread(f.extractall, path=self._gamedir)
|
await asyncio.to_thread(f.extractall, path=self._gamedir)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user