Avoid API call when listing packages
This commit is contained in:
parent
d066d4e098
commit
ca7277aea4
@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|||||||
|
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "unhacs"
|
name = "unhacs"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
description = "Command line interface to install Home Assistant Community Store packages"
|
description = "Command line interface to install Home Assistant Community Store packages"
|
||||||
authors = ["Ian Fijolek <ian@iamthefij.com>"]
|
authors = ["Ian Fijolek <ian@iamthefij.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@ -35,7 +35,10 @@ class Package:
|
|||||||
def __init__(self, url: str, version: str | None = None, name: str | None = None):
|
def __init__(self, url: str, version: str | None = None, name: str | None = None):
|
||||||
self.url = url
|
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("/")
|
parts = url.split("/")
|
||||||
repo = parts[-1]
|
repo = parts[-1]
|
||||||
|
Loading…
Reference in New Issue
Block a user