diff options
Diffstat (limited to 'bumper')
-rwxr-xr-x | bumper | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -27,9 +27,10 @@ class Bumper(cliapp.Application): def process_args(self, args): version = args[0] - filename = args[1] print 'Preparing release version', version + filename = self.find_version_py() + print 'Setting version in', filename self.write_version_py(filename, version, '') @@ -63,6 +64,16 @@ class Bumper(cliapp.Application): version, 'Bump version number post-release to {}'.format(gitversion)) + def find_version_py(self): + output = cliapp.runcmd(['git', 'ls-files']) + filenames = [x.strip() for x in output.splitlines()] + version_pys = [x for x in filenames if x.endswith('/version.py')] + if len(version_pys) == 0: + raise cliapp.AppException('No version.py in project') + elif len(version_pys) > 1: + raise cliapp.AppException('Too many version.py in project') + return version_pys[0] + def update_debian_changelog(self, version, msg): debian_version = '{}-1'.format(version) cliapp.runcmd(['dch', '-v', debian_version, msg]) |