Skip to content
Snippets Groups Projects
Commit 4b4573ee authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

Use git dir

parent 7563100b
No related branches found
No related tags found
1 merge request!95Feat: take version from git
......@@ -118,7 +118,7 @@ def deconsolize_args(args):
def extract_title_author_version(nb):
""" Tries to extract title, author from markdown.
Version is taken from git.
The version is taken from git.
"""
first_md = first_markdown_cell(nb)
......@@ -130,8 +130,10 @@ def extract_title_author_version(nb):
title = title[0] if len(title) else None
author = author[0] if len(author) else None
chdir(os.path.dirname(__file__))
version = check_output(["git", 'describe', '--tag']).decode('utf8')
git_dir = '{}/../.git'.format(os.path.dirname(__file__))
version = check_output(['git',
'--git-dir={}'.format(git_dir),
'describe', '--tag']).decode('utf8')
version = version.replace("\n", "")
return title, author, version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment