0
|
1 #!/usr/bin/env python3
|
|
2 import os.path
|
|
3
|
|
4 from cge.out.util.generator import Generator
|
|
5
|
|
6 from git import Repo
|
|
7
|
|
8
|
|
9 # git_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
|
10 git_path = os.path.abspath(os.path.dirname(__file__))
|
|
11 print("Git path: {}".format(git_path))
|
|
12 repo = Repo(git_path)
|
|
13 commit = repo.commit()
|
|
14
|
|
15 com2tag = {}
|
|
16 for tag in repo.tags:
|
|
17 com2tag[tag.commit.hexsha] = str(tag)
|
|
18
|
|
19 version = com2tag.get(repo.commit().hexsha, repo.commit().hexsha[:7])
|
|
20 print("Version: {}".format(version))
|
|
21
|
|
22 git_path = os.path.abspath(os.path.dirname(__file__))
|
|
23 result = Generator.init_software_result(name="ResFinder", gitdir=git_path)
|
|
24 print(str(result))
|