Skip to content

Commit

Permalink
Merge pull request #74 from kbrewersq/consistent_args_munki_repo
Browse files Browse the repository at this point in the history
Adding consistency to args for makecalogs
  • Loading branch information
homebysix authored Jan 5, 2024
2 parents f79163d + f12b58f commit 5f6f1f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,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

0 comments on commit 5f6f1f0

Please sign in to comment.