mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
refactor: Simplify tags URL construction and remove unused import
This commit is contained in:
parent
ae6192111d
commit
1ab5238405
1 changed files with 4 additions and 3 deletions
|
@ -3,7 +3,6 @@
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
@ -50,10 +49,12 @@ def main():
|
||||||
_, _, _, owner, repo = repo_url.rstrip("/").split("/")
|
_, _, _, owner, repo = repo_url.rstrip("/").split("/")
|
||||||
|
|
||||||
# Construct the raw file URL
|
# Construct the raw file URL
|
||||||
|
# Build the GitHub raw content path
|
||||||
|
base_url = f"https://raw.githubusercontent.com/{owner}/{repo}/{branch}"
|
||||||
if directory:
|
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:
|
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
|
# Create the language directory in the output path
|
||||||
lang_dir = os.path.join(output_dir, lang)
|
lang_dir = os.path.join(output_dir, lang)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue