Skip to content

Commit

Permalink
improve version printing when run from a checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
evax committed May 15, 2012
1 parent c1e1e7b commit f1e8bfb
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/cdist/__init__.py
Expand Up @@ -19,7 +19,17 @@
#
#

VERSION = "2.0.9"
import os
import subprocess

try:
with open(os.devnull, 'w') as devnull:
here = os.path.dirname(os.path.realpath(__file__))
VERSION = subprocess.check_output(
'cd "%s" && git describe' % here,
stderr=devnull, shell=True).decode('utf-8')
except:
VERSION = "2.0.9"

BANNER = """
.. . .x+=:. s
Expand All @@ -38,8 +48,6 @@
DOT_CDIST = ".cdist"


import os

class Error(Exception):
"""Base exception class for this project"""
pass
Expand Down

0 comments on commit f1e8bfb

Please sign in to comment.