Skip to content

Commit

Permalink
coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
kuritka committed Mar 17, 2021
1 parent fcf3df5 commit 5e55b1a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ create `.licignore` in project root
Install and run **GOLIC**
```shell
# GO 1.16
go install github.com/AbsaOSS/golic@v0.4.2
go install github.com/AbsaOSS/golic@v0.4.3
golic inject -c="2021 MyCompany ltd."
```

Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ var rootCmd = &cobra.Command{
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
if exitCode == 0 {
logger.Info().Msgf("done %s%s%s", emoji.Rocket, emoji.Rocket, emoji.Rocket)
logger.Info().Msgf("%s%s%s done", emoji.Rocket, emoji.Rocket, emoji.Rocket)
} else {
logger.Info().Msgf("done with changes %s", emoji.FaceScreamingInFear)
logger.Info().Msgf("%s exit", emoji.FaceScreamingInFear)
}
os.Exit(exitCode)
},
Expand Down
8 changes: 5 additions & 3 deletions impl/inject/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ func (i *Inject) traverse() {
if !i.Ignore(path) {
var skip bool
symbol := ""
cp := aurora.BrightYellow(path)
visited++
if err,skip = inject(path,o, config); skip {
symbol = "-> skip"
cp = aurora.Magenta(path)
skipped++
}
emoji.Printf(" %s %s %s \n",emoji.Minus, aurora.BrightYellow(path), aurora.BrightMagenta(symbol))
emoji.Printf(" %s %s %s \n",emoji.Minus, cp, aurora.BrightMagenta(symbol))
}
return
}
Expand All @@ -133,10 +135,10 @@ func (i *Inject) traverse() {

func summary(skipped, visited int) {
if skipped == visited {
fmt.Printf("\n %s %v/%v %s\n\n", emoji.Ice, aurora.BrightCyan(visited-skipped), aurora.BrightWhite(visited), aurora.BrightBlue("changed"))
fmt.Printf("\n %s %v/%v %s\n\n", emoji.Ice, aurora.BrightCyan(visited-skipped), aurora.BrightWhite(visited), aurora.BrightCyan("changed"))
return
}
fmt.Printf("\n %s %v/%v %s\n\n", emoji.Fire, aurora.BrightMagenta(visited-skipped), aurora.BrightWhite(visited), aurora.BrightYellow("changed"))
fmt.Printf("\n %s %v/%v %s\n\n", emoji.Fire, aurora.BrightYellow(visited-skipped), aurora.BrightWhite(visited), aurora.BrightYellow("changed"))
}

func inject(path string, o Options, config *Config) (err error, skip bool) {
Expand Down

0 comments on commit 5e55b1a

Please sign in to comment.