Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding consistency to args for makecalogs #74

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ After adding a hook to your pre-commit config, it's not a bad idea to run `pre-c

This hook runs the "makecatalogs" command to ensure all referenced packages are present and catalogs are up to date.

- Specify an alternate munki repo location by passing the argument:
`args: ['--munki-repo', './my_repo_location']`
(default: ".")

## Note about combining arguments

When combining arguments that take lists (for example: `--required-keys`, `--catalogs`, and `--categories`), only the _last_ list needs to have a trailing `--`. For example, if you use the check-munki-pkgsinfo hook with only the `--catalogs` argument, your yaml config would look like this:
Expand Down
2 changes: 1 addition & 1 deletion pre_commit_hooks/munki_makecatalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def build_argument_parser():
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument(
"--munki_repo", default=".", help="Path to local Munki repo. (Defaults to '.')"
"--munki-repo", default=".", help="Path to local Munki repo. (Defaults to '.')"
)
# TODO: Support makecatalogs options, ideally with kwargs for flexibility.
return parser
Expand Down