mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 20:01:02 +00:00
19 lines
291 B
Go
19 lines
291 B
Go
package ui
|
|
|
|
import (
|
|
"github.com/charmbracelet/huh"
|
|
)
|
|
|
|
func Confirm(prompt string) (bool, error) {
|
|
var confirm bool
|
|
err := huh.NewConfirm().
|
|
Title(prompt).
|
|
Affirmative("Yes!").
|
|
Negative("No.").
|
|
Value(&confirm).Run()
|
|
if err != nil {
|
|
return false, err
|
|
}
|
|
|
|
return confirm, err
|
|
}
|