Fix version math

This commit is contained in:
iranl
2024-12-03 11:55:38 +01:00
parent 8a23eb3d03
commit db1cfb0d89
5 changed files with 18 additions and 12 deletions

View File

@@ -24,6 +24,7 @@ with open('ota/manifest.json', 'r+') as json_file:
if (args.build == 'none'):
data[args.ota_type]['time'] = "0000-00-00"
data[args.ota_type]['version'] = "No beta available"
data[args.ota_type]['version_int'] = "No beta available"
data[args.ota_type]['fullversion'] = "No beta available"
data[args.ota_type]['build'] = ""
data[args.ota_type]['number'] = "0"
@@ -37,12 +38,13 @@ with open('ota/manifest.json', 'r+') as json_file:
data[args.ota_type]['time'] = datetime.now(timezone.utc).strftime("%Y-%m-%d")
data[args.ota_type]['version'] = str(version)
data[args.ota_type]['version_int'] = str(version*100)
if (args.ota_type == "release"):
data[args.ota_type]['fullversion'] = str(version)
else:
data[args.ota_type]['fullversion'] = str(version) + "-" + args.ota_type + str(data[args.ota_type]['number'])
data[args.ota_type]['build'] = args.build
json_file.seek(0)
json.dump(data, json_file, indent=4)