Compare commits

..

3 commits

Author SHA1 Message Date
d4d6098241
mypy/grub 2024-09-14 00:17:17 +02:00
68cbe3cd88
mypy/ps 2024-09-14 00:13:59 +02:00
2ad223fa83
grub/extra 2024-09-14 00:07:34 +02:00
2 changed files with 9 additions and 8 deletions

View file

@ -25,8 +25,8 @@ def make_image(
pubkey_path: str | None = None,
) -> None:
"""Make a binary bootable image."""
args = [
("grub-mkimage",),
args: list[str | tuple[str, ...]] = [
"grub-mkimage",
("--compress", COMPRESSION),
("--format", image_format),
("--output", image_path),
@ -35,6 +35,6 @@ def make_image(
if pubkey_path:
args.append(("--pubkey", pubkey_path))
args.extend(modules)
if modules := MODULES.get(image_format):
args.extend(modules)
if extra_modules := MODULES.get(image_format):
args.extend(extra_modules)
ps.run(*args)

View file

@ -9,10 +9,11 @@ def get_tuples_args(*items: str | tuple[str, ...]) -> list[str]:
"""Turn arguments tuples into an arguments list."""
args: list[str] = []
for item in items:
if type(item) is tuple:
args.extend(item)
else:
match item:
case str():
args.append(item)
case tuple():
args.extend(item)
return args