Skip to content

Commit

Permalink
clean signature
Browse files Browse the repository at this point in the history
  • Loading branch information
rumenvasilev committed Sep 15, 2023
1 parent 63c8c8c commit 28cf22a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
6 changes: 2 additions & 4 deletions internal/core/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@ package core

import (
_ "embed"
"time"

"github.com/rumenvasilev/rvsecret/internal/config"
"github.com/rumenvasilev/rvsecret/internal/log"
"github.com/rumenvasilev/rvsecret/internal/stats"
"github.com/rumenvasilev/rvsecret/version"
)

//go:embed resources/banner.txt
var ASCIIBanner string

func HeaderInfo(cfg config.Config, stats *stats.Stats, log *log.Logger) {
func HeaderInfo(cfg config.Config, startTime string, log *log.Logger) {
if !cfg.JSONOutput && !cfg.CSVOutput {
log.Warn("%s", ASCIIBanner)
log.Important("%s v%s started at %s", version.Name, cfg.AppVersion, stats.StartedAt.Format(time.RFC3339))
log.Important("%s v%s started at %s", version.Name, cfg.AppVersion, startTime)
log.Important("Loaded %d signatures.", len(Signatures))
if cfg.WebServer {
log.Important("Web interface available at http://%s:%d/public", cfg.BindAddress, cfg.BindPort)
Expand Down
3 changes: 2 additions & 1 deletion internal/pkg/ghe/ghe.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ghe

import (
"fmt"
"time"

"github.com/rumenvasilev/rvsecret/internal/config"
"github.com/rumenvasilev/rvsecret/internal/core"
Expand Down Expand Up @@ -38,7 +39,7 @@ func Scan(log *log.Logger) error {

// By default we display a header to the user giving basic info about application. This will not be displayed
// during a silent run which is the default when using this in an automated fashion.
core.HeaderInfo(*cfg, sess.State.Stats, sess.Out)
core.HeaderInfo(*cfg, sess.State.Stats.StartedAt.Format(time.RFC3339), log)

log.Debug("We have these orgs: %s", sess.GithubUserOrgs)
log.Debug("We have these users: %s", sess.GithubUserLogins)
Expand Down
3 changes: 2 additions & 1 deletion internal/pkg/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package github

import (
"fmt"
"time"

"github.com/rumenvasilev/rvsecret/internal/config"
"github.com/rumenvasilev/rvsecret/internal/core"
Expand Down Expand Up @@ -37,7 +38,7 @@ func Scan(log *log.Logger) error {

// By default we display a header to the user giving basic info about application. This will not be displayed
// during a silent run which is the default when using this in an automated fashion.
core.HeaderInfo(*cfg, sess.State.Stats, sess.Out)
core.HeaderInfo(*cfg, sess.State.Stats.StartedAt.Format(time.RFC3339), sess.Out)

if cfg.Debug {
core.PrintDebug(sess)
Expand Down
4 changes: 3 additions & 1 deletion internal/pkg/gitlab/gitlab.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package gitlab

import (
"time"

"github.com/rumenvasilev/rvsecret/internal/config"
"github.com/rumenvasilev/rvsecret/internal/core"
"github.com/rumenvasilev/rvsecret/internal/log"
Expand Down Expand Up @@ -30,7 +32,7 @@ func Scan(log *log.Logger) error {

// By default we display a header to the user giving basic info about application. This will not be displayed
// during a silent run which is the default when using this in an automated fashion.
core.HeaderInfo(*cfg, sess.State.Stats, sess.Out)
core.HeaderInfo(*cfg, sess.State.Stats.StartedAt.Format(time.RFC3339), log)

cfg.GitlabAccessToken = viper.GetString("gitlab-api-token")

Expand Down
4 changes: 3 additions & 1 deletion internal/pkg/localgit/localgit.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package localgit

import (
"time"

"github.com/rumenvasilev/rvsecret/internal/config"
"github.com/rumenvasilev/rvsecret/internal/core"
"github.com/rumenvasilev/rvsecret/internal/log"
Expand Down Expand Up @@ -28,7 +30,7 @@ func Scan(log *log.Logger) error {
}
// By default we display a header to the user giving basic info about application. This will not be displayed
// during a silent run which is the default when using this in an automated fashion.
core.HeaderInfo(*cfg, sess.State.Stats, log)
core.HeaderInfo(*cfg, sess.State.Stats.StartedAt.Format(time.RFC3339), log)

err = core.GatherLocalRepositories(sess)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion internal/pkg/localpath/localpath.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package localpath

import (
"time"

"github.com/rumenvasilev/rvsecret/internal/config"
"github.com/rumenvasilev/rvsecret/internal/core"
"github.com/rumenvasilev/rvsecret/internal/log"
Expand Down Expand Up @@ -38,7 +40,7 @@ func Scan(log *log.Logger) error {

// By default we display a header to the user giving basic info about application. This will not be displayed
// during a silent run which is the default when using this in an automated fashion.
core.HeaderInfo(*cfg, sess.State.Stats, sess.Out)
core.HeaderInfo(*cfg, sess.State.Stats.StartedAt.Format(time.RFC3339), log)

for _, p := range cfg.LocalPaths {
if util.PathExists(p, log) {
Expand Down

0 comments on commit 28cf22a

Please sign in to comment.