Skip to content

Commit

Permalink
FIX: use blob instead of tree in blob url
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Dec 5, 2023
1 parent d80f6c2 commit 5c661be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sphinx_api_relink/linkcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ def get_blob_url(github_repo: str) -> str:
print_once(f"The URL {blob_url} seems not to exist", color=Fore.MAGENTA)
tag = _get_latest_tag()
if tag is not None:
blob_url = f"{repo_url}/tree/{tag}"
blob_url = f"{repo_url}/blob/{tag}"
print_once(f"--> falling back to {blob_url}", color=Fore.MAGENTA)
if _url_exists(blob_url):
return blob_url
blob_url = f"{repo_url}/tree/main"
blob_url = f"{repo_url}/blob/main"
print_once(f"--> falling back to {blob_url}", color=Fore.MAGENTA)
if _url_exists(blob_url):
return blob_url
blob_url = f"{repo_url}/tree/master"
blob_url = f"{repo_url}/blob/master"
print_once(f"--> falling back to {blob_url}", color=Fore.MAGENTA)
return blob_url

Expand Down

0 comments on commit 5c661be

Please sign in to comment.