Skip to content

Commit

Permalink
LEFTHOOK_QUIET environment variable with the same function as skip_ou…
Browse files Browse the repository at this point in the history
…tput
  • Loading branch information
washtubs committed May 18, 2021
1 parent 7b94e77 commit 55a75cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,13 @@ func isSkipPrintOutput(outputDetailValue string) bool {
}
}

env := os.Getenv("LEFTHOOK_QUIET")
for _, elem := range strings.Split(env, ",") {
if strings.TrimSpace(elem) == outputDetailValue {
return true
}
}

return false
}

Expand Down
6 changes: 6 additions & 0 deletions docs/full_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ skip_output:
- success
- summary
```

You can also do this with an environment variable:
```bash
export LEFTHOOK_QUIET="meta,success,summary"
```

## CI integration

Enable `CI` env variable if it doens't exists on your service by default.
Expand Down

0 comments on commit 55a75cb

Please sign in to comment.