Skip to content

Commit

Permalink
delete prompt #23
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Jul 23, 2020
1 parent 1661f28 commit 6543e79
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,21 @@ var deleteCmd = &cobra.Command{
return
}

choice, err := prompt.Select(
fmt.Sprintf("Are you sure"),
[]string{"No", "Yes"},
)

if err != nil {
fmt.Printf("Error: %s", err.Error())
return
}

if choice == "No" {
fmt.Println(Red("Service file deletion skipped!"))
return
}

spin := spinner.New(spinner.CharSets[26], 100*time.Millisecond)
spin.Color("green")
spin.Start()
Expand All @@ -120,7 +135,7 @@ var deleteCmd = &cobra.Command{
fmt.Printf("Error: %s", err.Error())
}

fmt.Println(Green("Service file deleted successfully"))
fmt.Println(Green("Service file deleted successfully!"))
},
}

Expand Down

0 comments on commit 6543e79

Please sign in to comment.