Skip to content

Commit be59145

Browse files
noirbizarreLee-W
authored andcommitted
fix(filename): ensure file_name can be passed to changelog from bump command
1 parent 241faad commit be59145

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

commitizen/cli.py

+4
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ def __call__(self, parser, namespace, kwarg, option_string=None):
257257
"help": "keep major version at zero, even for breaking changes",
258258
},
259259
*deepcopy(tpl_arguments),
260+
{
261+
"name": "--file-name",
262+
"help": "file name of changelog (default: 'CHANGELOG.md')",
263+
},
260264
{
261265
"name": ["--prerelease-offset"],
262266
"type": int,

commitizen/commands/bump.py

+5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def __init__(self, config: BaseConfig, arguments: dict):
5252
"major_version_zero",
5353
"prerelease_offset",
5454
"template",
55+
"file_name",
5556
]
5657
if arguments[key] is not None
5758
},
@@ -79,6 +80,9 @@ def __init__(self, config: BaseConfig, arguments: dict):
7980
self.config, arguments["version_scheme"] or deprecated_version_type
8081
)
8182
self.template = arguments["template"] or self.config.settings.get("template")
83+
self.file_name = arguments["file_name"] or self.config.settings.get(
84+
"changelog_file"
85+
)
8286
self.extras = arguments["extras"]
8387

8488
def is_initial_tag(self, current_tag_version: str, is_yes: bool = False) -> bool:
@@ -278,6 +282,7 @@ def __call__(self): # noqa: C901
278282
"dry_run": dry_run,
279283
"template": self.template,
280284
"extras": self.extras,
285+
"file_name": self.file_name,
281286
},
282287
)
283288
changelog_cmd()

0 commit comments

Comments
 (0)