Skip to content

Commit

Permalink
Support python3 for bump script
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed Dec 16, 2019
1 parent 0657f57 commit 365e65c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/bump.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
from __future__ import unicode_literals
import argparse
import io
import os
Expand Down Expand Up @@ -30,12 +31,19 @@ def _replace_file_content(cls,
f.write(new_content)

def patch(self):
self._replace_file_content(self._config_path, r'("version": )("[^"]+")(,)', '\\1"' + self._version + '"\\3')
self._replace_file_content(self._config_path,
r'("version": )("[^"]+")(,)',
'\\1"' + self._version + '"\\3')


def parse_args():
arg_parser = argparse.ArgumentParser()

arg_parser.add_argument('--version', '-V', type=str, required=True, help='Bump packages version')
arg_parser.add_argument('--version',
'-V',
type=str,
required=True,
help='Bump packages version')

args = arg_parser.parse_args()
return args
Expand All @@ -52,5 +60,6 @@ def main():
package_root = os.path.join(ROOT_DIR, 'packages', package)
PackageConfigPatcher(package_root, version).patch()


if __name__ == '__main__':
main()

0 comments on commit 365e65c

Please sign in to comment.