From 6f1ed33a20c808b0a15589b2b4bb36a1205bdc76 Mon Sep 17 00:00:00 2001 From: LiCybora <40160522+LiCybora@users.noreply.github.com> Date: Fri, 25 Jan 2019 12:52:07 +0800 Subject: [PATCH] push version update --- Extension Compiler/updates.json | 4 ++-- Extension Compiler/version-update.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 Extension Compiler/version-update.py diff --git a/Extension Compiler/updates.json b/Extension Compiler/updates.json index 19c3e54eb6d2b..17c3ee080fd14 100644 --- a/Extension Compiler/updates.json +++ b/Extension Compiler/updates.json @@ -3,9 +3,9 @@ "{0f929014-5ed2-4527-8b8d-86a9c889b129}": { "updates": [ { - "version": "1.0.0.81", + "version": "1.0.0.85", "applications": { "gecko": { "strict_min_version": "52.0" } }, - "update_link": "https://github.com/LiCybora/NanoCoreFirefox/releases/download/v1.0.0.81/nano_adblocker-1.0.0.81-an+fx.xpi" + "update_link": "https://github.com/LiCybora/NanoCoreFirefox/releases/download/v1.0.0.85/nano_adblocker-1.0.0.85-an+fx.xpi" } ] } diff --git a/Extension Compiler/version-update.py b/Extension Compiler/version-update.py new file mode 100644 index 0000000000000..74a735337ca5a --- /dev/null +++ b/Extension Compiler/version-update.py @@ -0,0 +1,16 @@ +import json + +moz_id = "{0f929014-5ed2-4527-8b8d-86a9c889b129}"; + +with open("updates.json", 'r') as v: + data = v.read() + info = json.loads(data) + old_version = info["addons"][moz_id]["updates"][0]["version"] + + with open("../src/manifest.json", 'r') as f: + new_version = json.load(f)["version"] + + data = data.replace(old_version, new_version) + +with open("updates.json", 'w') as v: + v.write(data)