You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.7 KiB

import os
version = ''
contents = ''
with open('../onionr/', 'r') as f:
contents =
version = contents.split("ONIONR_VERSION = '")[1].split("'")[0]
print('Current Onionr release version is %s (MAJOR.MINOR.VERSION)\n' % version)
new_version = input('Enter new version: ')
int(new_version.replace('.', ''))
print('Invalid version number, try again.')
confirm = input('Please confirm the version change from %s to %s (y/N): ' % (version, new_version))
if confirm.lower().startswith('y'):
print('- Updating version in')
with open('../onionr/', 'w+') as f:
f.write(contents.replace("ONIONR_VERSION = '%s'" % version, "ONIONR_VERSION = '%s'" % new_version))
print('- Updating version in PKGBUILD')
with open('../onionr/PKGBUILD', 'w+') as f:
f.write("pkgver=%s" % version, "pkgver=%s" % new_version))
print('- Committing changes')
os.system('cd ..; git add onionr/; git commit -m "Increment Onionr version to %s"' % new_version)
print('- Adding tag')
os.system('cd ..; git tag %s' % new_version)
print('- Pushing changes')
# os.system('cd ..; git push origin --tags')
print('\n------\n\nAll done. Create a merge request into master at this link:\n\n')
print('\nNOTE: The default configuration file was not changed. Please make sure it is not in dev mode, and that log.verbosity is "error".')
print('Change cancelled. No action has been taken.')