Skip to content

Commit

Permalink
[PostProcessing] [BUGFIX] Partial revert: check for 'git' with shell=…
Browse files Browse the repository at this point in the history
…False.
  • Loading branch information
dsavoiu committed Aug 22, 2019
1 parent 646f5a9 commit d960a48
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions PostProcessing/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,21 @@ def get_version():
'''try to determine version via git'''
try:
# is git available?
subprocess.call('git status', shell=True, stdout=subprocess.PIPE)
except IOError:
subprocess.call('git', shell=False, stdout=subprocess.PIPE)
except OSError:
# 'git' not available
version = "dev"
return "dev"

try:
# in git repo?
subprocess.check_output('git status', shell=True)
except subprocess.CalledProcessError:
# not a 'git' repo
version = "dev"
else:
# 'git' found -> get release from git
# git repo found -> get release from git

# is 'git describe' working
# is 'git describe' working>
try:
# git describe working -> use output
version = subprocess.check_output('git describe', shell=True).strip().decode()
Expand Down

0 comments on commit d960a48

Please sign in to comment.