Launcher: fix detection of valid .apworld (#4272)
This commit is contained in:
parent
6656528d78
commit
a3711eb463
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue