From 587c49f6b1197dbd8d9b57f74a41ebd7372c0ba7 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 3 Oct 2017 15:35:49 -0400 Subject: [PATCH] Fix formatting on bump-version. --- script/bump-version.py | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/script/bump-version.py b/script/bump-version.py index 653473cd2786..8664736cca35 100755 --- a/script/bump-version.py +++ b/script/bump-version.py @@ -14,38 +14,40 @@ SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): 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' +' --stable to promote current beta to stable, or\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 ) parser.add_argument( - '--version', - default=None, - dest='new_version', + '--version', + default=None, + dest='new_version', help='new version number' ) parser.add_argument( - '--bump', - action='store', - default=None, - dest='bump', + '--bump', + action='store', + default=None, + dest='bump', help='increment [major | minor | patch | beta]' ) parser.add_argument( - '--stable', - action='store_true', - default= False, - dest='stable', + '--stable', + action='store_true', + default= False, + dest='stable', help='promote to stable (i.e. remove `-beta.x` suffix)' ) parser.add_argument( - '--dry-run', - action='store_true', - default= False, - dest='dry_run', + '--dry-run', + action='store_true', + default= False, + dest='dry_run', help='just to check that version number is correct' ) @@ -56,10 +58,10 @@ def main(): return 1 increments = ['major', 'minor', 'patch', 'beta'] - + curr_version = get_electron_version() versions = parse_version(re.sub('-beta', '', curr_version)) - + if args.bump in increments: versions = increase_version(versions, increments.index(args.bump)) if versions[3] == '0':