fix: handle huh user aborted error at main (#578)

This commit is contained in:
Mikael Fangel 2024-05-25 18:41:34 +00:00 committed by GitHub
commit 2b0a4c033e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,6 +7,7 @@ import (
"runtime/debug"
"github.com/alecthomas/kong"
"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
@ -72,7 +73,7 @@ func main() {
},
)
if err := ctx.Run(); err != nil {
if errors.Is(err, exit.ErrAborted) {
if errors.Is(err, exit.ErrAborted) || errors.Is(err, huh.ErrUserAborted) {
os.Exit(exit.StatusAborted)
}
fmt.Println(err)