mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Launcher: fix detection of valid .apworld (#4272)
This commit is contained in:
@@ -103,7 +103,7 @@ def _install_apworld(apworld_src: str = "") -> Optional[Tuple[pathlib.Path, path
|
|||||||
try:
|
try:
|
||||||
import zipfile
|
import zipfile
|
||||||
zip = zipfile.ZipFile(apworld_path)
|
zip = zipfile.ZipFile(apworld_path)
|
||||||
directories = [f.filename.strip('/') for f in zip.filelist if f.CRC == 0 and f.file_size == 0 and f.filename.count('/') == 1]
|
directories = [f.name for f in zipfile.Path(zip).iterdir() if f.is_dir()]
|
||||||
if len(directories) == 1 and directories[0] in apworld_path.stem:
|
if len(directories) == 1 and directories[0] in apworld_path.stem:
|
||||||
module_name = directories[0]
|
module_name = directories[0]
|
||||||
apworld_name = module_name + ".apworld"
|
apworld_name = module_name + ".apworld"
|
||||||
|
Reference in New Issue
Block a user