diff --git a/addon_updater.py b/addon_updater.py index 290da12..ca9e6d1 100644 --- a/addon_updater.py +++ b/addon_updater.py @@ -1740,11 +1740,15 @@ class ForgejoEngine: """Integration to Forgejo/Gitea API""" def __init__(self): - self.api_url = 'https://git.pointer.click' + # the api_url may be overwritten by form_repo_url + # if updater.host is set + self.api_url = 'https://codeberg.org' self.token = None self.name = "forgejo" def form_repo_url(self, updater): + if updater.host: + self.api_url = "https://" + updater.host return "{}/api/v1/repos/{}/{}".format(self.api_url, updater.user, updater.repo) def form_tags_url(self, updater): diff --git a/addon_updater_ops.py b/addon_updater_ops.py index 6cc021d..0c3e108 100644 --- a/addon_updater_ops.py +++ b/addon_updater_ops.py @@ -72,7 +72,7 @@ except Exception as e: # not match and have errors. Must be all lowercase and no spaces! Should also # be unique among any other addons that could exist (using this updater code), # to avoid clashes in operator registration. -updater.addon = "addon_updater_demo" +updater.addon = "abc3d" # ----------------------------------------------------------------------------- @@ -1346,6 +1346,10 @@ def register(bl_info): # updater.engine = "GitLab" # updater.engine = "Bitbucket" + # set your host. + # only Forgejo. (codeberg.org is default if not specified). + updater.host = "git.pointer.click" + # If using private repository, indicate the token here. # Must be set after assigning the engine. # **WARNING** Depending on the engine, this token can act like a password!! @@ -1392,7 +1396,7 @@ def register(bl_info): updater.backup_current = True # True by default # Sample ignore patterns for when creating backup of current during update. - updater.backup_ignore_patterns = ["__pycache__"] + updater.backup_ignore_patterns = [".git", "__pycache__", "*.bat", ".gitignore", "*.exe"] # Alternate example patterns: # updater.backup_ignore_patterns = [".git", "__pycache__", "*.bat", ".gitignore", "*.exe"] @@ -1461,7 +1465,7 @@ def register(bl_info): # Note: updater.include_branch_list defaults to ['master'] branch if set to # none. Example targeting another multiple branches allowed to pull from: # updater.include_branch_list = ['master', 'dev'] - updater.include_branch_list = ['main'] # None is the equivalent = ['master'] + updater.include_branch_list = ['main', 'dev'] # None is the equivalent = ['master'] # Only allow manual install, thus prompting the user to open # the addon's web page to download, specifically: updater.website