()
| 65 | |
| 66 | |
| 67 | def _git_commit_hash(): |
| 68 | res = subprocess.run("git rev-parse --is-inside-work-tree".split(), cwd="./", stdout=subprocess.PIPE) |
| 69 | if res.stdout.decode().strip() == "true": |
| 70 | res = subprocess.run("git rev-parse HEAD".split(), cwd=os.getcwd(), stdout=subprocess.PIPE) |
| 71 | return res.stdout.decode().strip() |
| 72 | else: |
| 73 | return None |