Skip to content

Commit

Permalink
fix(filename): ensure file_name can be passed to changelog from `…
Browse files Browse the repository at this point in the history
…bump` command
  • Loading branch information
noirbizarre authored and Lee-W committed Oct 18, 2023
1 parent 241faad commit be59145
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions commitizen/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ def __call__(self, parser, namespace, kwarg, option_string=None):
"help": "keep major version at zero, even for breaking changes",
},
*deepcopy(tpl_arguments),
{
"name": "--file-name",
"help": "file name of changelog (default: 'CHANGELOG.md')",
},
{
"name": ["--prerelease-offset"],
"type": int,
Expand Down
5 changes: 5 additions & 0 deletions commitizen/commands/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(self, config: BaseConfig, arguments: dict):
"major_version_zero",
"prerelease_offset",
"template",
"file_name",
]
if arguments[key] is not None
},
Expand Down Expand Up @@ -79,6 +80,9 @@ def __init__(self, config: BaseConfig, arguments: dict):
self.config, arguments["version_scheme"] or deprecated_version_type
)
self.template = arguments["template"] or self.config.settings.get("template")
self.file_name = arguments["file_name"] or self.config.settings.get(
"changelog_file"
)
self.extras = arguments["extras"]

def is_initial_tag(self, current_tag_version: str, is_yes: bool = False) -> bool:
Expand Down Expand Up @@ -278,6 +282,7 @@ def __call__(self): # noqa: C901
"dry_run": dry_run,
"template": self.template,
"extras": self.extras,
"file_name": self.file_name,
},
)
changelog_cmd()
Expand Down

0 comments on commit be59145

Please sign in to comment.