Skip to content

Commit

Permalink
fix: handle huh user aborted error at main (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelFangel committed May 25, 2024
1 parent 4222e59 commit 2b0a4c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"runtime/debug"

"github.com/alecthomas/kong"
"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2b0a4c0

Please sign in to comment.