X Tutup
Skip to content

Commit b0b90af

Browse files
committed
issue/pr create: exit with nonzero status code when "Cancel" was chosen
This is to indicate that the command had not finished successfully.
1 parent d6798b1 commit b0b90af

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pkg/cmd/issue/create/create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ func createRun(opts *CreateOptions) (err error) {
249249

250250
if action == prShared.CancelAction {
251251
fmt.Fprintln(opts.IO.ErrOut, "Discarding.")
252+
err = cmdutil.SilentError
252253
return
253254
}
254255
} else {

pkg/cmd/pr/create/create.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ func createRun(opts *CreateOptions) (err error) {
299299

300300
if action == shared.CancelAction {
301301
fmt.Fprintln(opts.IO.ErrOut, "Discarding.")
302-
return nil
302+
err = cmdutil.SilentError
303+
return
303304
}
304305

305306
err = handlePush(*opts, *ctx)

0 commit comments

Comments
 (0)
X Tutup