Skip to content

Commit

Permalink
Fix linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowmoose committed Oct 11, 2022
1 parent f4c6e21 commit fee2730
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pyderman/util/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from pyderman.util import downloader


def make_asset_url(author, project, version) -> str:
def make_asset_url(author: str, project: str, version: str) -> str:
return f"https://github.com/{author}/{project}/releases/expanded_assets/{version}"


def make_releases_url(author, project, version) -> str:
def make_releases_url(author: str, project: str, version: str) -> str:
return f"https://github.com/{author}/{project}/releases/{version}"


Expand All @@ -19,9 +19,12 @@ def find_links(
if not version:
version = "latest"
if version == "latest":
version = downloader.get_redirect(
redirect = downloader.get_redirect(
make_releases_url(author, project, version)
).split("/")[-1]
)
if not redirect:
raise Exception(f"Unable to locate latest version of {project}")
version = redirect.split("/")[-1]
if not version.startswith(prefix):
version = "{}{}".format(prefix, version)
repo = make_asset_url(author, project, version)
Expand Down

0 comments on commit fee2730

Please sign in to comment.