mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix: do not ask for confirmation right after prompting for input
secret set, variable set, team create, webhook create and admin user create asked a confirmation that defaults to No right after the user typed the missing values, so pressing Enter discarded the input. They now submit what the user entered; deletions still confirm. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
6 files changed
+43
-29
No files matched your search
@@ -88,7 +88,6 @@ func (a *application) webhookCommand() *cobra.Command {
|
||||
command.RunE = func(cmd *cobra.Command, args []string) error {
|
||||
var id int64
|
||||
var err error
|
||||
prompted := false
|
||||
opts := services.WebhookOptions{}
|
||||
if verb != "create" {
|
||||
id, err = number(args[0])
|
||||
@@ -125,8 +124,7 @@ func (a *application) webhookCommand() *cobra.Command {
|
||||
endpoint = args[0]
|
||||
}
|
||||
if verb == "create" {
|
||||
prompted, err = a.require(cmd, &endpoint, "url")
|
||||
if err != nil {
|
||||
if _, err := a.require(cmd, &endpoint, "url"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -200,12 +198,8 @@ func (a *application) webhookCommand() *cobra.Command {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if verb == "delete" || prompted {
|
||||
subject := endpoint
|
||||
if verb == "delete" {
|
||||
subject = args[0]
|
||||
}
|
||||
if err := a.confirm(cmd, verb+" webhook "+subject); err != nil {
|
||||
if verb == "delete" {
|
||||
if err := a.confirm(cmd, "delete webhook "+args[0]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user