Avoid API call when listing packages
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
IamTheFij 2024-06-10 15:07:00 -07:00
parent d066d4e098
commit ca7277aea4
2 changed files with 5 additions and 2 deletions

View File

@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "unhacs"
version = "0.2.0"
version = "0.2.1"
description = "Command line interface to install Home Assistant Community Store packages"
authors = ["Ian Fijolek <ian@iamthefij.com>"]
license = "MIT"

View File

@ -35,7 +35,10 @@ class Package:
def __init__(self, url: str, version: str | None = None, name: str | None = None):
self.url = url
self.version, self.zip_url = self.fetch_version_release(version)
if not version:
self.version, self.zip_url = self.fetch_version_release(version)
else:
self.version = version
parts = url.split("/")
repo = parts[-1]