Skip to content

Commit

Permalink
print only on analyze command (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
noamd-legit authored Jan 7, 2024
1 parent dd26e70 commit 26129a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 9 additions & 0 deletions cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"
"github.com/fatih/color"
"os"
"strings"

Expand Down Expand Up @@ -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("[email protected]")
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())
Expand Down
10 changes: 0 additions & 10 deletions cmd/common_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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("[email protected]")

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())
}
Expand Down

0 comments on commit 26129a2

Please sign in to comment.