This is an automated email from the ASF dual-hosted git repository.
brile pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid-website-src.git
The following commit(s) were added to refs/heads/master by this push:
new 9c987d26 script: add if statement for delete so that the script doesnt
fail (#461)
9c987d26 is described below
commit 9c987d2687e4d9577ad43f3d39dd00c732d02229
Author: 317brian <[email protected]>
AuthorDate: Wed Feb 21 12:37:48 2024 -0800
script: add if statement for delete so that the script doesnt fail (#461)
---
scripts/copy_druid_docs.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/copy_druid_docs.py b/scripts/copy_druid_docs.py
index 4f6fe786..9f22d13d 100755
--- a/scripts/copy_druid_docs.py
+++ b/scripts/copy_druid_docs.py
@@ -86,7 +86,8 @@ def is_it_latest(druid_version, source_directory,
destination_directory_latest):
if is_latest == 'y':
print("Also copying the docs to docs/latest.")
subprocess.run(["rsync", "--delete", "--recursive",
f"{source_directory}/docs/", destination_directory_latest])
- shutil.rmtree(f"{destination_directory_latest}/_bin")
+ if os.path.exists(f"{destination_directory_latest}/_bin"):
+ shutil.rmtree(f"{destination_directory_latest}/_bin")
do_the_replace(destination_directory_latest, druid_version)
elif is_latest == 'n':
print("Not copying the docs to docs/latest")
@@ -106,8 +107,8 @@ def main(druid_version, source_directory="../../druid"):
subprocess.run(["rsync", "--delete", "--recursive",
f"{source_directory}/docs/", destination_directory])
# deletes the _bin directory that's not needed
- shutil.rmtree(f"{destination_directory}/_bin")
-
+ if os.path.exists(f"{destination_directory_latest}/_bin"):
+ shutil.rmtree(f"{destination_directory_latest}/_bin")
# Copy sidebars.json and redirects.json
shutil.copyfile(source_directory+"/website/sidebars.json",
"../sidebars.json")
shutil.copyfile(source_directory+"/website/redirects.js",
"../redirects.js")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]