Skip to content

Commit

Permalink
golangci
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 committed Jun 28, 2023
1 parent 7e32b21 commit 4165cda
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@ func getCommands() []cli.Command {
HideHelp: true,
Hidden: true,
Flags: cliutils.GetCommandFlags(cliutils.Intro),
Action: func(c *cli.Context) error {
return IntroCmd()
},
Action: IntroCmd,
},
{
Name: cliutils.CmdOptions,
Expand Down Expand Up @@ -308,7 +306,7 @@ func SetupCmd(c *cli.Context) error {
return envsetup.RunEnvSetupCmd(c, format)
}

func IntroCmd() error {
func IntroCmd(_ *cli.Context) error {
ci, err := clientutils.GetBoolEnvValue(coreutils.CI, false)
if ci || err != nil {
return err
Expand Down
11 changes: 11 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,14 @@ func initDeploymentViewTest(t *testing.T) (assertDeploymentViewFunc func(), clea
}
return
}

func TestIntro(t *testing.T) {
buffer, _, previousLog := coreTests.RedirectLogOutputToBuffer()
defer clientlog.SetLogger(previousLog)

setEnvCallBack := clientTestUtils.SetEnvWithCallbackAndAssert(t, "CI", "false")
defer setEnvCallBack()

runJfrogCli(t, "intro")
assert.Contains(t, buffer.String(), "Thank you for installing version")
}

0 comments on commit 4165cda

Please sign in to comment.