Fix formatting on bump-version.

This commit is contained in:
John Kleinschmidt 2017-10-03 15:35:49 -04:00
parent 211688453c
commit 587c49f6b1

View file

@ -14,38 +14,40 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def main(): def main():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Bump version numbers. Must specify at least one of the three options:\n' description='Bump version numbers. Must specify at least one of the three'
+' options:\n'
+' --bump=patch to increment patch version, or\n' +' --bump=patch to increment patch version, or\n'
+' --stable to promote current beta to stable, or\n' +' --stable to promote current beta to stable, or\n'
+' --version={version} to set version number directly\n' +' --version={version} to set version number directly\n'
+'Note that you can use both --bump and --stable simultaneously.', +'Note that you can use both --bump and --stable '
+'simultaneously.',
formatter_class=argparse.RawTextHelpFormatter formatter_class=argparse.RawTextHelpFormatter
) )
parser.add_argument( parser.add_argument(
'--version', '--version',
default=None, default=None,
dest='new_version', dest='new_version',
help='new version number' help='new version number'
) )
parser.add_argument( parser.add_argument(
'--bump', '--bump',
action='store', action='store',
default=None, default=None,
dest='bump', dest='bump',
help='increment [major | minor | patch | beta]' help='increment [major | minor | patch | beta]'
) )
parser.add_argument( parser.add_argument(
'--stable', '--stable',
action='store_true', action='store_true',
default= False, default= False,
dest='stable', dest='stable',
help='promote to stable (i.e. remove `-beta.x` suffix)' help='promote to stable (i.e. remove `-beta.x` suffix)'
) )
parser.add_argument( parser.add_argument(
'--dry-run', '--dry-run',
action='store_true', action='store_true',
default= False, default= False,
dest='dry_run', dest='dry_run',
help='just to check that version number is correct' help='just to check that version number is correct'
) )
@ -56,10 +58,10 @@ def main():
return 1 return 1
increments = ['major', 'minor', 'patch', 'beta'] increments = ['major', 'minor', 'patch', 'beta']
curr_version = get_electron_version() curr_version = get_electron_version()
versions = parse_version(re.sub('-beta', '', curr_version)) versions = parse_version(re.sub('-beta', '', curr_version))
if args.bump in increments: if args.bump in increments:
versions = increase_version(versions, increments.index(args.bump)) versions = increase_version(versions, increments.index(args.bump))
if versions[3] == '0': if versions[3] == '0':