rexbacklight/scripts/git_branch_name.py

9 lines
232 B
Python
Executable File

#!/usr/bin/python
import subprocess
output = subprocess.run(['git', 'rev-parse', "--abbrev-ref", "HEAD"], stdout=subprocess.PIPE).stdout.decode('utf-8').rstrip()
if output:
print("#define GIT_BRANCH_NAME " + '"' + output + '"')