From 58279670b6757dccb510721ec3461aac87c51c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Wed, 7 Aug 2024 16:17:14 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Refactor=20script=20`deploy=5Fdo?= =?UTF-8?q?cs=5Fstatus.py`=20to=20account=20for=20deploy=20URLs=20with=20o?= =?UTF-8?q?r=20without=20trailing=20slash=20(#11965)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/deploy_docs_status.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/deploy_docs_status.py b/scripts/deploy_docs_status.py index b19989235..e00fa2be0 100644 --- a/scripts/deploy_docs_status.py +++ b/scripts/deploy_docs_status.py @@ -49,6 +49,7 @@ def main(): files = list(use_pr.get_files()) docs_files = [f for f in files if f.filename.startswith("docs/")] + deploy_url = settings.deploy_url.rstrip("/") lang_links: dict[str, list[str]] = {} for f in docs_files: match = re.match(r"docs/([^/]+)/docs/(.*)", f.filename) @@ -60,9 +61,9 @@ def main(): else: path = path.replace(".md", "/") if lang == "en": - link = f"{settings.deploy_url}{path}" + link = f"{deploy_url}/{path}" else: - link = f"{settings.deploy_url}{lang}/{path}" + link = f"{deploy_url}/{lang}/{path}" lang_links.setdefault(lang, []).append(link) links: list[str] = [] @@ -79,9 +80,7 @@ def main(): current_lang_links.sort() links.extend(current_lang_links) - message = ( - f"📝 Docs preview for commit {settings.commit_sha} at: {settings.deploy_url}" - ) + message = f"📝 Docs preview for commit {settings.commit_sha} at: {deploy_url}" if links: message += "\n\n### Modified Pages\n\n"