diff --git a/cmd/analyze.go b/cmd/analyze.go index 648cbfe3..5a38de57 100644 --- a/cmd/analyze.go +++ b/cmd/analyze.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "github.com/fatih/color" "os" "strings" @@ -44,6 +45,14 @@ func newAnalyzeCommand() *cobra.Command { Short: `Analyze GitHub/GitLab organizations associated with a PAT to find security issues`, RunE: executeAnalyzeCommand, SilenceUsage: true, + PostRun: func(cmd *cobra.Command, args []string) { + lineStart := color.New(color.FgMagenta, color.Bold).Sprintf("--->") + legitify := color.New(color.FgMagenta, color.Bold).Sprintf("legitify") + legitifyMail := color.New(color.FgMagenta, color.Bold).Sprintf("legitify@legitsecurity.com") + legitText := fmt.Sprintf("%s If you have any questions or you need assistance using %s,"+ + " please don't hesitate REACHING OUT @ %s", lineStart, legitify, legitifyMail) + screen.Printf("%s", legitText) + }, } scorecardWhens := toOptionsString(scorecardOptions()) diff --git a/cmd/common_args.go b/cmd/common_args.go index 0079bf7d..e6a3f597 100644 --- a/cmd/common_args.go +++ b/cmd/common_args.go @@ -13,7 +13,6 @@ import ( "github.com/Legit-Labs/legitify/internal/outputer/scheme" "github.com/Legit-Labs/legitify/internal/outputer/scheme/converter" "github.com/Legit-Labs/legitify/internal/screen" - "github.com/fatih/color" "github.com/spf13/pflag" "github.com/spf13/viper" ) @@ -101,15 +100,6 @@ func (a *args) applyOutputOptions() (preExitHook func(), err error) { buf.WriteString(fmt.Sprintf("Some policies skipped. Check %s for more details\n", permFile.Name())) } - lineStart := color.New(color.FgMagenta, color.Bold).Sprintf("--->") - legitify := color.New(color.FgMagenta, color.Bold).Sprintf("legitify") - legitifyMail := color.New(color.FgMagenta, color.Bold).Sprintf("legitify@legitsecurity.com") - - legitText := fmt.Sprintf("%s If you have any questions or you need assistance using %s,"+ - " please don't hesitate REACHING OUT @ %s", lineStart, legitify, legitifyMail) - - buf.WriteString(legitText) - if buf.Len() > 0 { screen.Printf("\n\n%s\n", buf.String()) }