From b0b90afa872ccaceedeac8610f788af896e53dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Tue, 23 Feb 2021 17:06:29 +0100 Subject: [PATCH] issue/pr create: exit with nonzero status code when "Cancel" was chosen This is to indicate that the command had not finished successfully. --- pkg/cmd/issue/create/create.go | 1 + pkg/cmd/pr/create/create.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/issue/create/create.go b/pkg/cmd/issue/create/create.go index 0b2a93cd4..3d6b5b25c 100644 --- a/pkg/cmd/issue/create/create.go +++ b/pkg/cmd/issue/create/create.go @@ -249,6 +249,7 @@ func createRun(opts *CreateOptions) (err error) { if action == prShared.CancelAction { fmt.Fprintln(opts.IO.ErrOut, "Discarding.") + err = cmdutil.SilentError return } } else { diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index 52539b8f5..18b8c1e99 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -299,7 +299,8 @@ func createRun(opts *CreateOptions) (err error) { if action == shared.CancelAction { fmt.Fprintln(opts.IO.ErrOut, "Discarding.") - return nil + err = cmdutil.SilentError + return } err = handlePush(*opts, *ctx)