-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/UMONS-GFA/ardas
- Loading branch information
Showing
3 changed files
with
170 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import subprocess | ||
import os | ||
|
||
|
||
def get_version(): | ||
""" Get the current version from git info | ||
:return: a string foramted as branch_name | last_named_tag-number_of_commits_ahead-commit_number | ||
""" | ||
dir = os.path.dirname(__file__) | ||
branch = subprocess.check_output('cd ' + dir + '; git rev-parse --abbrev-ref HEAD', shell=True) | ||
version = subprocess.check_output('cd ' + dir + '; git describe --long --dirty --abbrev=6 --tags', shell=True) | ||
return branch.decode('ascii')[:-1] + ' | ' + version.decode('ascii')[:-1] | ||
|
||
if __name__ == '__main__': | ||
print(get_version()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters