fix unhandled exception if publish target doesn't exist

It wasn't actually that we didn't create it, but that we tried to clean
first and the folder to be cleaned didn't exist!
This commit is contained in:
Soren I. Bjornstad 2021-09-21 09:36:27 -05:00
parent 5e7a1e3d22
commit 2d33b53be6

View File

@ -312,7 +312,10 @@ def compile_html_file(
f"(To overwrite any files existing in the output folder, " f"(To overwrite any files existing in the output folder, "
f"set overwrite = True for this builder.)") f"set overwrite = True for this builder.)")
try:
shutil.rmtree(output_folder) shutil.rmtree(output_folder)
except FileNotFoundError:
pass
shutil.copytree( shutil.copytree(
Path(build_state['public_wiki_folder']) / "output", Path(build_state['public_wiki_folder']) / "output",
Path(output_folder), Path(output_folder),
@ -637,7 +640,10 @@ def editionify(target_folder: str, description: str) -> None:
:param description: The description of this edition to use in the new edition's :param description: The description of this edition to use in the new edition's
``tiddlywiki.info`` file. ``tiddlywiki.info`` file.
""" """
try:
shutil.rmtree(target_folder) shutil.rmtree(target_folder)
except FileNotFoundError:
pass
shutil.copytree( shutil.copytree(
build_state['public_wiki_folder'], build_state['public_wiki_folder'],
target_folder, target_folder,