From 1ab5238405e11968a560c612b890471ab41c0601 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 12 Mar 2025 13:52:55 -0700 Subject: [PATCH] refactor: Simplify tags URL construction and remove unused import --- scripts/tsl_pack_langs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/tsl_pack_langs.py b/scripts/tsl_pack_langs.py index 042028e23..846c22801 100644 --- a/scripts/tsl_pack_langs.py +++ b/scripts/tsl_pack_langs.py @@ -3,7 +3,6 @@ import json import os import sys -from pathlib import Path import requests @@ -50,10 +49,12 @@ def main(): _, _, _, owner, repo = repo_url.rstrip("/").split("/") # Construct the raw file URL + # Build the GitHub raw content path + base_url = f"https://raw.githubusercontent.com/{owner}/{repo}/{branch}" if directory: - tags_url = f"https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{directory}/queries/tags.scm" + tags_url = f"{base_url}/{directory}/queries/tags.scm" else: - tags_url = f"https://raw.githubusercontent.com/{owner}/{repo}/{branch}/queries/tags.scm" + tags_url = f"{base_url}/queries/tags.scm" # Create the language directory in the output path lang_dir = os.path.join(output_dir, lang)