Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

build-help-center: Don't fail the first time.

Tim Abbotted2e9777c970
diff --git a/tools/convert-help-center-docs-to-mdx b/tools/convert-help-center-docs-to-mdx
index abbfd67f38b..3d2e097cf54 100755
--- a/tools/convert-help-center-docs-to-mdx
+++ b/tools/convert-help-center-docs-to-mdx
@@ -592,9 +592,11 @@ def run() -> None:
include_output_dir = os.path.join(output_dir, "include")
print("Starting the conversion from MD to MDX...")
- # We delete the directory first to remove any stale files
- # that might have been deleted in the `help` folder but
- # their converted mdx files stay around
+ # We delete the directory first to remove any stale files that
+ # might have been deleted in the `help` folder but their converted
+ # mdx files stay around. We create it first just in case to avoid
+ # rmtree throwing exceptions.
+ os.makedirs(output_dir, exist_ok=True)
shutil.rmtree(output_dir)
os.makedirs(output_dir, exist_ok=True)