Rename tag zip and add branch zip
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
273199a9a6
commit
ea982ee5a9
@ -84,5 +84,10 @@ def get_latest_sha(repository_url: str, branch_name: str) -> str:
|
||||
raise ValueError(f"branch name '{branch_name}' not found for {repository_url}")
|
||||
|
||||
|
||||
def get_ref_zip(repository_url: str, tag_name: str) -> str:
|
||||
def get_tag_zip(repository_url: str, tag_name: str) -> str:
|
||||
return f"{repository_url}/archive/refs/tags/{tag_name}.zip"
|
||||
|
||||
def get_branch_zip(repository_url: str, branch_name: str) -> str:
|
||||
return f"{repository_url}/archive/{branch_name}.zip"
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@ import requests
|
||||
import yaml
|
||||
|
||||
from unhacs.git import get_latest_sha
|
||||
from unhacs.git import get_ref_zip
|
||||
from unhacs.git import get_tag_zip
|
||||
from unhacs.git import get_repo_tags
|
||||
|
||||
DEFAULT_HASS_CONFIG_PATH: Path = Path(".")
|
||||
@ -235,7 +235,7 @@ class Package:
|
||||
|
||||
def install_integration(self, hass_config_path: Path):
|
||||
"""Installs the integration package."""
|
||||
zipball_url = get_ref_zip(self.url, self.version)
|
||||
zipball_url = get_tag_zip(self.url, self.version)
|
||||
response = requests.get(zipball_url)
|
||||
response.raise_for_status()
|
||||
|
||||
@ -266,7 +266,7 @@ class Package:
|
||||
def install_fork_component(self, hass_config_path: Path):
|
||||
"""Installs the integration from hass fork."""
|
||||
assert self.fork_component
|
||||
zipball_url = get_ref_zip(self.url, self.version)
|
||||
zipball_url = get_tag_zip(self.url, self.version)
|
||||
response = requests.get(zipball_url)
|
||||
response.raise_for_status()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user