File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -174,11 +174,15 @@ def _write_changelog(
174
174
175
175
changelog_file .write (changelog_out )
176
176
177
- def _export_template (self ) -> None :
178
- tpl = changelog .get_changelog_template (self .cz .template_loader , self .template )
179
- # TODO: fix the following type ignores
180
- src = Path (tpl .filename ) # type: ignore[arg-type]
181
- Path (self .export_template_to ).write_text (src .read_text ()) # type: ignore[arg-type]
177
+ def _export_template (self , dist : str ) -> None :
178
+ filename = changelog .get_changelog_template (
179
+ self .cz .template_loader , self .template
180
+ ).filename
181
+ if filename is None :
182
+ raise NotAllowed ("Template filename is not set" )
183
+
184
+ text = Path (filename ).read_text ()
185
+ Path (dist ).write_text (text )
182
186
183
187
def __call__ (self ) -> None :
184
188
commit_parser = self .cz .commit_parser
@@ -195,7 +199,7 @@ def __call__(self) -> None:
195
199
)
196
200
197
201
if self .export_template_to :
198
- return self ._export_template ()
202
+ return self ._export_template (self . export_template_to )
199
203
200
204
if not changelog_pattern or not commit_parser :
201
205
raise NoPatternMapError (
You can’t perform that action at this time.
0 commit comments