Add lndg to version script

This commit is contained in:
Taylor Helsper 2022-05-17 23:14:53 -05:00
parent 9ef81acece
commit cdb6a94996

View File

@ -29,6 +29,7 @@ apps = [{"name": "bitcoin/bitcoin", "current_version_var
{"name": "dojo/samourai-dojo", "current_version_variable": "DOJO_VERSION"},
#{"name": "JoinMarket-Org/joinmarket-clientserver", "current_version_variable": "JOINMARKET_VERSION"}, # Old, now use within joininbox
{"name": "curly60e/pyblock", "current_version_variable": "PYBLOCK_VERSION"},
{"name": "cryptosharks131/lndg", "dynamic_app_name": "lndg"},
]
# Apps that don't work or are not on GitHub
@ -56,6 +57,17 @@ def get_current_version_from_variable(version_variable):
return "UNKNOWN FAIL"
return "UNKNOWN " + version_variable
def get_current_version_from_dynamic_app(app_name):
try:
filename = "../rootfs/standard/usr/share/mynode_apps/{}/{}.json".format(app_name, app_name)
with open(filename, "r") as f:
json_data = json.load(f)
if "latest_version" in json_data:
return json_data["latest_version"]
except:
return "UNKNOWN FAIL 1"
return "UNKNOWN FAIL 2"
def get_app_version_data(app_name, current_version):
success = False
github_url = "https://api.github.com/repos/" + app_name + "/releases/latest"
@ -111,6 +123,8 @@ def check_app_versions():
current_version = "UNKNOWN"
if "current_version_variable" in app:
current_version = get_current_version_from_variable(app["current_version_variable"])
elif "dynamic_app_name" in app:
current_version = get_current_version_from_dynamic_app(app["dynamic_app_name"])
else:
current_version = app["current_version"]