MCPcopy Create free account
hub / github.com/MaverickPeter/vDiSCO / get_git_commit_number

Function get_git_commit_number

prnet/__init__.py:11–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11def get_git_commit_number():
12 if not (Path(__file__).parent / '../.git').exists():
13 return '0000000'
14
15 cmd_out = subprocess.run(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE)
16 git_commit_number = cmd_out.stdout.decode('utf-8')[:7]
17 return git_commit_number
18
19
20script_version = get_git_commit_number()

Callers 1

__init__.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected