fix: name --from-pack and the packs beside a typo

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 12:20:44 +01:00
1 parent 3d694c7d70
commit fd36670532
5 files changed
+33 -11

No files matched your search

+9 -1
View File
@@ -10888,7 +10888,15 @@ class PackSource:
elif path.is_file():
given.append(path)
else:
raise ValueError(f"{path} does not exist")
# "X does not exist" named neither the option nor the packs
# beside it, where a typo in the name is the usual cause.
near = sorted(p.name for p in path.parent.glob("*_BIOS_Pack*.zip")
if p.is_file()) if path.parent.is_dir() else []
beside = (f" The packs in {path.parent}: {', '.join(near[:3])}"
+ (f" and {len(near) - 3} more" if len(near) > 3 else "") + "."
if near else "")
raise ValueError(f"{path} does not exist: --from-pack names a pack ZIP, "
f"its parts or the folder holding them.{beside}")
if not given:
raise ValueError(f"no pack ZIP in {', '.join(map(str, paths))}")
packs: dict[str, list[Path]] = {}