From 0f1aaae57ce75dd14f50e9381cb778ddc1865291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 18 Feb 2022 17:12:43 +0100 Subject: [PATCH] issue/pr comment: allow using editor in non-interactive mode The user should be able to `gh config set prompt disabled` and still be allowed to use `gh issue comment --editor`. --- pkg/cmd/pr/shared/commentable.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkg/cmd/pr/shared/commentable.go b/pkg/cmd/pr/shared/commentable.go index 2ddc770a6..788e86c5d 100644 --- a/pkg/cmd/pr/shared/commentable.go +++ b/pkg/cmd/pr/shared/commentable.go @@ -68,10 +68,6 @@ func CommentablePreRun(cmd *cobra.Command, opts *CommentableOptions) error { return cmdutil.FlagErrorf("flags required when not running interactively") } opts.Interactive = true - } else if inputFlags == 1 { - if !opts.IO.CanPrompt() && opts.InputType == InputTypeEditor { - return cmdutil.FlagErrorf("`--body`, `--body-file` or `--web` required when not running interactively") - } } else if inputFlags > 1 { return cmdutil.FlagErrorf("specify only one of `--body`, `--body-file`, `--editor`, or `--web`") }