Skip to content

Commit 26129a2

Browse files
authored
print only on analyze command (#288)
1 parent dd26e70 commit 26129a2

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

cmd/analyze.go

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cmd
22

33
import (
44
"fmt"
5+
"github.com/fatih/color"
56
"os"
67
"strings"
78

@@ -44,6 +45,14 @@ func newAnalyzeCommand() *cobra.Command {
4445
Short: `Analyze GitHub/GitLab organizations associated with a PAT to find security issues`,
4546
RunE: executeAnalyzeCommand,
4647
SilenceUsage: true,
48+
PostRun: func(cmd *cobra.Command, args []string) {
49+
lineStart := color.New(color.FgMagenta, color.Bold).Sprintf("--->")
50+
legitify := color.New(color.FgMagenta, color.Bold).Sprintf("legitify")
51+
legitifyMail := color.New(color.FgMagenta, color.Bold).Sprintf("legitify@legitsecurity.com")
52+
legitText := fmt.Sprintf("%s If you have any questions or you need assistance using %s,"+
53+
" please don't hesitate REACHING OUT @ %s", lineStart, legitify, legitifyMail)
54+
screen.Printf("%s", legitText)
55+
},
4756
}
4857

4958
scorecardWhens := toOptionsString(scorecardOptions())

cmd/common_args.go

-10
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/Legit-Labs/legitify/internal/outputer/scheme"
1414
"github.com/Legit-Labs/legitify/internal/outputer/scheme/converter"
1515
"github.com/Legit-Labs/legitify/internal/screen"
16-
"github.com/fatih/color"
1716
"github.com/spf13/pflag"
1817
"github.com/spf13/viper"
1918
)
@@ -101,15 +100,6 @@ func (a *args) applyOutputOptions() (preExitHook func(), err error) {
101100
buf.WriteString(fmt.Sprintf("Some policies skipped. Check %s for more details\n", permFile.Name()))
102101
}
103102

104-
lineStart := color.New(color.FgMagenta, color.Bold).Sprintf("--->")
105-
legitify := color.New(color.FgMagenta, color.Bold).Sprintf("legitify")
106-
legitifyMail := color.New(color.FgMagenta, color.Bold).Sprintf("legitify@legitsecurity.com")
107-
108-
legitText := fmt.Sprintf("%s If you have any questions or you need assistance using %s,"+
109-
" please don't hesitate REACHING OUT @ %s", lineStart, legitify, legitifyMail)
110-
111-
buf.WriteString(legitText)
112-
113103
if buf.Len() > 0 {
114104
screen.Printf("\n\n%s\n", buf.String())
115105
}

0 commit comments

Comments
 (0)