save a file to alocal folder and make it executable

This commit is contained in:
Stanislas Jouffroy 2025-03-04 00:06:09 +01:00
parent e54626d971
commit 230cf99f06
8 changed files with 122 additions and 21 deletions

16
majordome/main.py Normal file
View file

@ -0,0 +1,16 @@
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)