f4pga/setup: optionally use .gitcommit
Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
This commit is contained in:
parent
2eddad761b
commit
b730305701
|
@ -55,6 +55,11 @@ def get_requirements(file: Path) -> List[str]:
|
||||||
semver = "0.0.0"
|
semver = "0.0.0"
|
||||||
version = None
|
version = None
|
||||||
|
|
||||||
|
with (packagePath.parent / '.gitcommit').open("r") as rptr:
|
||||||
|
sha = rptr.read().strip()
|
||||||
|
if sha != '$Format:%h$':
|
||||||
|
version = f'{semver}-{sha}'
|
||||||
|
|
||||||
git = which('git')
|
git = which('git')
|
||||||
if git is not None:
|
if git is not None:
|
||||||
proc = run(['git', 'rev-parse', 'HEAD'], capture_output=True)
|
proc = run(['git', 'rev-parse', 'HEAD'], capture_output=True)
|
||||||
|
|
Loading…
Reference in New Issue