Fixed creating parent folders when extracting mods

The parent directory of any given file path was incorrectly determined to be the game directory.
Also issue #2 (file extracted into wrong spot when mod uses no folder structure) is fixed
dev
Peery 5 months ago
parent dbd21789c9
commit 332f69f2de
Signed by: pandro
SSH Key Fingerprint: SHA256:iBUZSuDxqYr4hYpe9U3BA9NJmXKpbGt4H0S8hUwIbrA

@ -384,8 +384,8 @@ class ModManager:
if content.endswith(os.path.sep):
self.__logger.debug(f"Skipped moving of {os.path.join(tmp_dir, content)}")
continue
parent_dir = os.path.join(self.__settings.get_game_folder().replace("/", os.path.sep),
file.replace("/", os.path.sep)).split(file.replace("/", os.path.sep))[0]
parent_dir = os.path.join(self.__settings.get_game_folder(), file).split(os.path.basename(file))[0]\
.replace("/", os.path.sep)
if not os.path.exists(parent_dir):
os.mkdir(parent_dir)
if not os.path.exists(os.path.join(self.__settings.get_game_folder().replace("/", os.path.sep),

Loading…
Cancel
Save