MaJordome/majordome/main.py

16 lines
519 B
Python

from pathlib import Path
from majordome.github_service import GithubConnector
from majordome.settings import GithubSettings
from majordome.software_repo import SoftwareRepo
settings = GithubSettings()
github_service = GithubConnector(settings.token)
def download_latest(
url: str, asset_mnemonic: str, tag_mnemonic: str, destination: Path
):
software_repo = SoftwareRepo(url, github_service, tag_mnemonic, asset_mnemonic)
asset = software_repo.download_latest_asset()
destination.write_bytes(asset)