Skip to content

Commit f6c0dbe

Browse files
authored
copy_on_build should not fail on nonexistent extensions (#1502)
1 parent 45e428d commit f6c0dbe

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

makePDF.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -906,13 +906,15 @@ def do_finish(self, can_switch_to_pdf):
906906
)
907907
elif isinstance(copy_on_build, list):
908908
for ext in copy_on_build:
909-
shutil.copy2(
910-
os.path.join(
911-
self.output_directory,
912-
self.tex_base + ext
913-
),
914-
os.path.dirname(self.file_name)
909+
copy_file = os.path.join(
910+
self.output_directory,
911+
self.tex_base + ext
915912
)
913+
if os.path.isfile(copy_file):
914+
shutil.copy2(
915+
copy_file,
916+
os.path.dirname(self.file_name)
917+
)
916918

917919
if get_setting('open_pdf_on_build', True, view=self.view):
918920
self.view.run_command("jump_to_pdf", {"from_keybinding": False})

0 commit comments

Comments
 (0)