chore: style the machine reset prompt in red and fix the padding for [y/N]

This commit is contained in:
Pasha Sviderski
2026-04-22 19:00:38 +10:00
parent d340659370
commit 7b554cd703
2 changed files with 16 additions and 7 deletions
+7 -7
View File
@@ -106,21 +106,21 @@ func promptResetMachine() error {
"use --yes flag or set UNCLOUD_AUTO_CONFIRM=true to auto-confirm")
}
fmt.Println(tui.Red.Render("The remote machine is already initialised as a cluster member. Resetting it will:\n" +
"- Remove all service containers from the machine\n" +
"- Reset the machine to the uninitialised state"))
var confirm bool
form := huh.NewForm(
huh.NewGroup(
huh.NewConfirm().
Title(
"The remote machine is already initialised as a cluster member. Do you want to reset it first?\n" +
"This will:\n" +
"- Remove all service containers from the machine\n" +
"- Reset the machine to the uninitialised state",
).
Title("Do you want to reset it first?").
Affirmative("Yes!").
Negative("No").
Value(&confirm),
),
).WithAccessible(true)
).WithTheme(tui.ThemeConfirmDanger()).
WithAccessible(true)
if err := form.Run(); err != nil {
return fmt.Errorf("prompt user to confirm: %w", err)
}