Skip to content

Commit

Permalink
feat: use built-in ErrUserAborted instead of == check (#104)
Browse files Browse the repository at this point in the history
y3owk1n authored Dec 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 17d01e3 commit 244ccad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/project.go
Original file line number Diff line number Diff line change
@@ -105,7 +105,7 @@ func SelectProject(projects []utils.Directory) (string, error) {

err := form.Run()
if err != nil {
if err.Error() == "user aborted" {
if err == huh.ErrUserAborted {
utils.Logger.Debug("User aborted project selection")
fmt.Println("Until next time!")
os.Exit(0)
@@ -227,7 +227,7 @@ func handleExistingFile(sourcePath, destinationPath string) error {

err := form.Run()
if err != nil {
if err.Error() == "user aborted" {
if err == huh.ErrUserAborted {
utils.Logger.Debug("User aborted project selection")
fmt.Println("Until next time!")
os.Exit(0)
@@ -258,7 +258,7 @@ func ConfirmCwd() error {

err := form.Run()
if err != nil {
if err.Error() == "user aborted" {
if err == huh.ErrUserAborted {
utils.Logger.Debug("User aborted project selection")
fmt.Println("Until next time!")
os.Exit(0)

0 comments on commit 244ccad

Please sign in to comment.