From 551a06cb4b124d0bc6a7bf49bc53df1803719541 Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Thu, 24 Nov 2022 10:30:23 +0100 Subject: [PATCH] This YAML file needs a specific order, otherwise the AppImage will not load. Fixes T235 --- AppImageBuilder.yml | 2 +- tools/update_version.py | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml index 6851229..76609c3 100644 --- a/AppImageBuilder.yml +++ b/AppImageBuilder.yml @@ -20,7 +20,7 @@ AppDir: id: pkm.vogel.nmreval name: NMReval icon: logo - version: 0.2.0 + version: _devel_ # Set the python executable as entry point exec: usr/bin/python3 # Set the application main script path as argument. Use '$@' to forward CLI parameters diff --git a/tools/update_version.py b/tools/update_version.py index c7a9041..e18ab0d 100755 --- a/tools/update_version.py +++ b/tools/update_version.py @@ -2,10 +2,11 @@ import os import yaml -if __name__ == "__main__": +if __name__ == "__main__this_is_broken": if "GO_PIPELINE_LABEL" in os.environ: version = os.environ["GO_PIPELINE_LABEL"] appimage_yaml = yaml.safe_load(open("AppImageBuilder.yml")) + appimage_old_version = appimage_yaml["AppDir"]["app_info"]["version"] appimage_yaml["AppDir"]["app_info"]["version"] = version with open(f"AppImageBuilder{version}.yml","wb") as yaml_file: yaml.safe_dump(appimage_yaml, yaml_file, encoding = 'utf-8') @@ -13,3 +14,15 @@ if __name__ == "__main__": else: print("No GO_PIPELINE_LABEL found, doing nothing") +if __name__ == "__main__": + if "GO_PIPELINE_LABEL" in os.environ: + version = os.environ["GO_PIPELINE_LABEL"] + src_version = open("AppImageBuilder.yml").readlines() + with open(f"AppImageBuilder{version}.yml","w") as new_version: + for line in src_version: + cp_line = line.replace("version: _devel_", f"version: {version}") + new_version.write(f"{cp_line}") + + + +