diff options
Diffstat (limited to 'b4/command.py')
-rw-r--r-- | b4/command.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/b4/command.py b/b4/command.py index d5f06dc..39ad3e5 100644 --- a/b4/command.py +++ b/b4/command.py @@ -187,11 +187,12 @@ if __name__ == '__main__': import os # noinspection PyBroadException try: - base = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) - dotgit = os.path.join(base, '.git') - ecode, short = b4.git_run_command(dotgit, ['rev-parse', '--short', 'HEAD']) - if ecode == 0: - b4.__VERSION__ = '%s-%.5s' % (b4.__VERSION__, short.strip()) + if b4.__VERSION__.find('-dev') > 0: + base = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + dotgit = os.path.join(base, '.git') + ecode, short = b4.git_run_command(dotgit, ['rev-parse', '--short', 'HEAD']) + if ecode == 0: + b4.__VERSION__ = '%s-%.5s' % (b4.__VERSION__, short.strip()) except Exception as ex: # Any failures above are non-fatal pass |