1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

autoupdater: Move upstream.rstrip('/') to rest_api classes

This commit is contained in:
Salamandar 2024-02-20 12:06:17 +01:00 committed by Salamandar
parent d9d6996727
commit 9863a82190
2 changed files with 2 additions and 2 deletions

View file

@ -461,7 +461,7 @@ class AppAutoUpdater:
self, strategy: str, asset: Union[str, dict], infos: dict[str, Any] self, strategy: str, asset: Union[str, dict], infos: dict[str, Any]
) -> Optional[tuple[str, Union[str, dict[str, str]], str]]: ) -> Optional[tuple[str, Union[str, dict[str, str]], str]]:
autoupdate = infos.get("autoupdate") autoupdate = infos.get("autoupdate")
upstream = autoupdate.get("upstream", self.main_upstream).strip("/") upstream = autoupdate.get("upstream", self.main_upstream)
version_re = autoupdate.get("version_regex", None) version_re = autoupdate.get("version_regex", None)
allow_prereleases = autoupdate.get("allow_prereleases", False) allow_prereleases = autoupdate.get("allow_prereleases", False)
_, remote_type, revision_type = strategy.split("_") _, remote_type, revision_type = strategy.split("_")

View file

@ -15,7 +15,7 @@ class RefType(Enum):
class GithubAPI: class GithubAPI:
def __init__(self, upstream: str, auth: Optional[tuple[str, str]] = None): def __init__(self, upstream: str, auth: Optional[tuple[str, str]] = None):
self.upstream = upstream self.upstream = upstream.strip("/")
self.upstream_repo = upstream.replace("https://github.com/", "").strip("/") self.upstream_repo = upstream.replace("https://github.com/", "").strip("/")
assert ( assert (
len(self.upstream_repo.split("/")) == 2 len(self.upstream_repo.split("/")) == 2