Save git hex revision in powerline version string if possible

Only useful for `pip install git+git://` or `pip install /some/directory` 
installations (note: commands come without `--editable`/`-e`).
This commit is contained in:
ZyX 2014-10-19 00:05:51 +04:00
parent f0d2f2884e
commit 2106be4066
1 changed files with 9 additions and 1 deletions

View File

@ -52,9 +52,17 @@ except Exception as e:
else: else:
can_use_scripts = False can_use_scripts = False
def get_version():
try:
return 'dev-' + subprocess.check_output(['git', 'rev-parse', 'HEAD'])
except Exception as e:
return 'dev'
setup( setup(
name='powerline-status', name='powerline-status',
version='dev', version=get_version(),
description='The ultimate statusline/prompt utility.', description='The ultimate statusline/prompt utility.',
long_description=README, long_description=README,
classifiers=[ classifiers=[