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(
174174
175175 changelog_file .write (changelog_out )
176176
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 )
182186
183187 def __call__ (self ) -> None :
184188 commit_parser = self .cz .commit_parser
@@ -195,7 +199,7 @@ def __call__(self) -> None:
195199 )
196200
197201 if self .export_template_to :
198- return self ._export_template ()
202+ return self ._export_template (self . export_template_to )
199203
200204 if not changelog_pattern or not commit_parser :
201205 raise NoPatternMapError (
You can’t perform that action at this time.
0 commit comments