Generate changelog link automatically in add_version_info
This commit is contained in:
parent
4695b156e0
commit
ff51aad139
1 changed files with 3 additions and 8 deletions
|
@ -9,12 +9,6 @@ import shutil
|
||||||
import json
|
import json
|
||||||
import traceback
|
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
|
MAJOR = None
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
|
@ -31,6 +25,7 @@ def main():
|
||||||
try:
|
try:
|
||||||
file = args.file
|
file = args.file
|
||||||
version = args.version
|
version = args.version
|
||||||
|
short_version = version[0:3]
|
||||||
|
|
||||||
# Back up JSON file
|
# Back up JSON file
|
||||||
shutil.copy2(file, file + '.bak')
|
shutil.copy2(file, file + '.bak')
|
||||||
|
@ -38,11 +33,11 @@ def main():
|
||||||
# Read in existing file
|
# Read in existing file
|
||||||
with open(file) as f:
|
with open(file) as f:
|
||||||
updates = json.loads(f.read())
|
updates = json.loads(f.read())
|
||||||
|
|
||||||
updates.append({
|
updates.append({
|
||||||
'version': version,
|
'version': version,
|
||||||
'buildID': args.build_id,
|
'buildID': args.build_id,
|
||||||
'detailsURL': DETAILS_URLS[version[0:3]],
|
'detailsURL': f'https://www.zotero.org/support/{short_version}_changelog',
|
||||||
'major': MAJOR
|
'major': MAJOR
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue