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 authored and Envek committed May 18, 2021
1 parent 13370c6 commit 8fe6b50
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 @@ -439,6 +439,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 @@ -493,6 +493,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 8fe6b50

Please sign in to comment.