Skip to content

Commit

Permalink
Add a cli argument for overriding the locker branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rahearn committed Aug 19, 2024
1 parent 8adad31 commit 6dc4de1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions prune/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from urllib.parse import urlparse

from compliance.utils.credentials import Config
from compliance.config import get_config

from ilcli import Command

Expand All @@ -36,6 +37,11 @@ def _init_arguments(self):
"as an example https://github.com/my-org/my-repo"
),
)
self.add_argument(
"--branch",
help="Branch name for locker repository",
default=False,
)
self.add_argument(
"--creds",
metavar="~/path/creds",
Expand Down Expand Up @@ -88,6 +94,10 @@ def _run(self, args):
gitconfig = None
if args.git_config or args.git_config_file:
gitconfig = args.git_config or json.loads(open(args.git_config_file).read())
if args.branch:
c = get_config()
c.load()
c.raw_config["locker"]["default_branch"] = args.branch
# self.name drives the Locker push mode.
# - dry-run translates to locker no-push mode
# - push-remote translates to locker full-remote mode
Expand Down

0 comments on commit 6dc4de1

Please sign in to comment.