opts guard and removing severity

This commit is contained in:
zach rice committed 2019-11-12 15:18:13 -05:00
1 parent e446ba0738
commit 315ee56024
17 files changed
+99 -121

No files matched your search

+1 -3
View File
@@ -20,7 +20,6 @@ func Run(m *manager.Manager) error {
}
m.Opts.RepoPath = fmt.Sprintf("%s/%s", m.Opts.OwnerPath, f.Name())
if err := runHelper(NewRepo(m)); err != nil {
// TODO or send to errchan?
return err
}
}
@@ -31,7 +30,6 @@ func Run(m *manager.Manager) error {
}
func runHelper(r *Repo) error {
// Check if gitleaks will perform a local audit.
if r.Manager.Opts.OpenLocal() {
r.Name = path.Base(r.Manager.Opts.RepoPath)
if err := r.Open(); err != nil {
@@ -41,7 +39,7 @@ func runHelper(r *Repo) error {
// Check if we are checking uncommitted files. This is the default behavior
// for a "$gitleaks" command with no options set
if r.Manager.Opts.CheckUncommitted() {
if err := r.AuditLocal(); err != nil {
if err := r.AuditUncommitted(); err != nil {
return err
}
return nil