Use branch zip for downloading forks
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
IamTheFij 2024-07-21 09:42:46 -07:00
parent ea982ee5a9
commit b019185380

View File

@ -13,9 +13,10 @@ from zipfile import ZipFile
import requests
import yaml
from unhacs.git import get_branch_zip
from unhacs.git import get_latest_sha
from unhacs.git import get_tag_zip
from unhacs.git import get_repo_tags
from unhacs.git import get_tag_zip
DEFAULT_HASS_CONFIG_PATH: Path = Path(".")
DEFAULT_PACKAGE_FILE = Path("unhacs.yaml")
@ -265,8 +266,10 @@ class Package:
def install_fork_component(self, hass_config_path: Path):
"""Installs the integration from hass fork."""
# TODO: Replace asserts with errors
assert self.fork_component
zipball_url = get_tag_zip(self.url, self.version)
assert self.branch_name
zipball_url = get_branch_zip(self.url, self.branch_name)
response = requests.get(zipball_url)
response.raise_for_status()