flash: improve prompt if no disk is specified
This commit is contained in:
parent
1c1c143b8d
commit
f7077e3540
@ -103,7 +103,11 @@ def flash_command(args: argparse.Namespace) -> None:
|
|||||||
machine = Machine(opts.machine, flake=opts.flake)
|
machine = Machine(opts.machine, flake=opts.flake)
|
||||||
if opts.confirm and not opts.dry_run:
|
if opts.confirm and not opts.dry_run:
|
||||||
disk_str = ", ".join(f"{name}={device}" for name, device in opts.disks.items())
|
disk_str = ", ".join(f"{name}={device}" for name, device in opts.disks.items())
|
||||||
ask = input(f"Install {machine.name} to {disk_str}? [y/N] ")
|
msg = f"Install {machine.name}"
|
||||||
|
if disk_str != "":
|
||||||
|
msg += f" to {disk_str}"
|
||||||
|
msg += "? [y/N] "
|
||||||
|
ask = input(msg)
|
||||||
if ask != "y":
|
if ask != "y":
|
||||||
return
|
return
|
||||||
flash_machine(machine, disks=opts.disks, dry_run=opts.dry_run, debug=opts.debug)
|
flash_machine(machine, disks=opts.disks, dry_run=opts.dry_run, debug=opts.debug)
|
||||||
|
Loading…
Reference in New Issue
Block a user