Generate changelog link automatically in add_version_info

This commit is contained in:
Dan Stillman 2023-05-17 02:52:11 -04:00
parent 4695b156e0
commit ff51aad139

View file

@ -9,12 +9,6 @@ import shutil
import json
import traceback
DETAILS_URLS = {
'4.0': 'https://www.zotero.org/support/4.0_changelog',
'5.0': 'https://www.zotero.org/support/5.0_changelog',
'6.0': 'https://www.zotero.org/support/6.0_changelog',
'7.0': 'https://www.zotero.org/support/7.0_changelog'
}
MAJOR = None
parser = argparse.ArgumentParser(
@ -31,6 +25,7 @@ def main():
try:
file = args.file
version = args.version
short_version = version[0:3]
# Back up JSON file
shutil.copy2(file, file + '.bak')
@ -38,11 +33,11 @@ def main():
# Read in existing file
with open(file) as f:
updates = json.loads(f.read())
updates.append({
'version': version,
'buildID': args.build_id,
'detailsURL': DETAILS_URLS[version[0:3]],
'detailsURL': f'https://www.zotero.org/support/{short_version}_changelog',
'major': MAJOR
})