mirror of
https://github.com/vbatts/git-validation.git
synced 2025-07-23 07:40:28 +00:00
main: adding a quiet flag to reduce the output
so you can test and just check return code Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
eba7575f7e
commit
769b4028a4
2 changed files with 14 additions and 2 deletions
|
@ -70,10 +70,18 @@ func (r *Runner) Run() error {
|
|||
|
||||
// run them and show results
|
||||
for _, commit := range c {
|
||||
fmt.Printf(" * %s %q ... ", commit["abbreviated_commit"], commit["subject"])
|
||||
if os.Getenv("QUIET") == "" {
|
||||
fmt.Printf(" * %s %q ... ", commit["abbreviated_commit"], commit["subject"])
|
||||
}
|
||||
vr := Commit(commit, r.Rules)
|
||||
r.Results = append(r.Results, vr...)
|
||||
if _, fail := vr.PassFail(); fail == 0 {
|
||||
_, fail := vr.PassFail()
|
||||
if os.Getenv("QUIET") != "" {
|
||||
// everything else in the loop is printing output.
|
||||
// If we're quiet, then just continue
|
||||
continue
|
||||
}
|
||||
if fail == 0 {
|
||||
fmt.Println("PASS")
|
||||
} else {
|
||||
fmt.Println("FAIL")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue