From 541ae526112d75ceba39c5f59ba27b33f3883424 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Wed, 29 May 2024 16:28:25 +0300 Subject: [PATCH] Fix npm script Signed-off-by: Michael Sverdlov --- general/ai/cli.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/general/ai/cli.go b/general/ai/cli.go index 8e3e930cd..fb6071a1a 100644 --- a/general/ai/cli.go +++ b/general/ai/cli.go @@ -7,7 +7,6 @@ import ( "errors" "fmt" "github.com/jfrog/jfrog-cli-core/v2/utils/coreutils" - "github.com/jfrog/jfrog-cli-core/v2/utils/ioutils" "github.com/jfrog/jfrog-cli/utils/cliutils" "github.com/jfrog/jfrog-client-go/http/httpclient" "github.com/jfrog/jfrog-client-go/utils/errorutils" @@ -87,7 +86,17 @@ func HowCmd(c *cli.Context) error { func (fb *FeedbackBody) getUserFeedback() { fb.IsAccurate = coreutils.AskYesNo("Is the provided command accurate?", true) if !fb.IsAccurate { - ioutils.ScanFromConsole("Please provide the exact command you expected (Example: 'jf rt u ...')", &fb.ExpectedAnswer, "") + scanner := bufio.NewScanner(os.Stdin) + fmt.Print("Please provide the exact command you expected (Example: 'jf rt u ...'): ") + for { + // Ask the user for a question + scanner.Scan() + fb.ExpectedAnswer = scanner.Text() + if fb.ExpectedAnswer != "" { + // If the user entered a question, break the loop + break + } + } } }