File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -175,10 +175,17 @@ def _write_changelog(
175175 changelog_file .write (changelog_out )
176176
177177 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]
178+ if self .export_template_to is None :
179+ raise NotAllowed ("Argument `--export-template` is not set" )
180+
181+ filename = changelog .get_changelog_template (
182+ self .cz .template_loader , self .template
183+ ).filename
184+ if filename is None :
185+ raise NotAllowed ("Template filename is not set" )
186+
187+ text = Path (filename ).read_text ()
188+ Path (self .export_template_to ).write_text (text )
182189
183190 def __call__ (self ) -> None :
184191 commit_parser = self .cz .commit_parser
You can’t perform that action at this time.
0 commit comments