Skip to content

Commit

Permalink
Addon Manager: Fix get_zip_url for non-github URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
chennes committed Jul 27, 2022
1 parent 71285f4 commit 0e2508c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Mod/AddonManager/addonmanager_utilities.py
Expand Up @@ -114,15 +114,15 @@ def restart_freecad():
def get_zip_url(repo):
"""Returns the location of a zip file from a repo, if available"""

parsedUrl = urlparse(repo.url)
if parsedUrl.netloc == "github.com":
parsed_url = urlparse(repo.url)
if parsed_url.netloc == "github.com":
return f"{repo.url}/archive/{repo.branch}.zip"
elif parsed_url.netloc in ["gitlab.com", "framagit.org", "salsa.debian.org"]:
return f"{repo.url}/-/archive/{repo.branch}/{repo.name}-{repo.branch}.zip"
else:
FreeCAD.Console.PrintLog(
"Debug: addonmanager_utilities.get_zip_url: Unknown git host fetching zip URL:",
parsedUrl.netloc,
parsed_url.netloc,
"\n",
)
return f"{repo.url}/-/archive/{repo.branch}/{repo.name}-{repo.branch}.zip"
Expand Down

0 comments on commit 0e2508c

Please sign in to comment.