Skip to content

Commit 99594c2

Browse files
committed
Improve handling paths
1 parent ad4fdb4 commit 99594c2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

scripts/portal-fetcher/openshift-docs-downloader.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,10 @@ def get_local_path(url: str, output_dir: Path) -> Path:
164164
doc_name = path_parts[doc_type_index + 1]
165165

166166
# Create the simplified path
167-
simple_path = f"{doc_name}"
168-
if path.endswith("/") or not path_parts[-1]:
169-
simple_path = f"{simple_path}/index.html"
170-
elif not path.endswith(".html"):
171-
simple_path = f"{simple_path}/index.html"
172-
173-
local_path = output_dir / simple_path
167+
if path.endswith("/") or not path_parts[-1] or not path.endswith(".html"):
168+
local_path = output_dir / doc_name / "index.html"
169+
else:
170+
local_path = output_dir / doc_name
174171
else:
175172
# Fallback if structure is unexpected
176173
if path.endswith("/"):

0 commit comments

Comments
 (0)