Skip to content

Commit

Permalink
Minor fix to get_version.
Browse files Browse the repository at this point in the history
  • Loading branch information
sixy6e committed Jun 8, 2016
1 parent 096c6e1 commit 0c99b1a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions gaip/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ def get_version():
'git',
'describe', '--tags', '--match', '[0-9]*', '--dirty'
]
with remember_cwd():
os.chdir(package_dir)
with remember_cwd():
os.chdir(package_dir)
try:
git_version = check_output(cmd).decode().strip()
except CalledProcessError:
raise RuntimeError('Unable to get version number from git tags')

components = git_version.split('-')
version = components.pop(0)
components = git_version.split('-')
version = components.pop(0)

# Any other suffixes imply this is not a release: Append an internal build number
if components:
# <commit count>.<git hash>.<whether the working tree is dirty>
version += '+' + '.'.join(components)
# Any other suffixes imply this is not a release: Append an internal build number
if components:
# <commit count>.<git hash>.<whether the working tree is dirty>
version += '+' + '.'.join(components)

return version

Expand Down

0 comments on commit 0c99b1a

Please sign in to comment.