Skip to content

Commit aa5b662

Browse files
committed
tc
1 parent 895c3ce commit aa5b662

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.jenkins/sphinx_files.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def main() -> None:
1111
files_to_run = calculate_shards(all_files, num_shards=20)[int(os.environ.get("WORKER_ID", "1")) - 1]
1212
files_to_run = [x for x in files_to_run if x not in [f"{f}.py" for f in NOT_RUN]]
1313

14-
os.makedirs("docs_to_zip", exist_ok=True)
14+
os.makedirs("/tmp/docs_to_zip", exist_ok=True)
1515

1616
env = os.environ.copy()
1717
for file in files_to_run:
@@ -23,11 +23,11 @@ def main() -> None:
2323
subprocess.check_output(["make", "postprocess"], env=env)
2424
for file in glob.glob(f"docs/**/*", recursive=True):
2525
if stem in file:
26-
os.makedirs(os.path.dirname(f"docs_to_zip/{file}"), exist_ok=True)
27-
shutil.copy(file, f"docs_to_zip/{file}")
26+
relative_path = Path(os.path.relpath(file, "docs"))
27+
os.makedirs(os.path.dirname(f"docs_to_zip/{relative_path.parent}"), exist_ok=True)
28+
shutil.copy(file, f"/tmp/docs_to_zip/{relative_path}")
2829
subprocess.check_output(["git", "reset", "--hard", "HEAD"])
29-
os.remove("docs")
30-
shutil.move("docs_to_zip", "docs")
30+
shutil.move("/tmp/docs_to_zip", "docs")
3131

3232
if __name__ == "__main__":
3333
main()

0 commit comments

Comments
 (0)