mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
214f1fbbed
Closes IDF-1504
16 lines
475 B
Python
16 lines
475 B
Python
import subprocess
|
|
|
|
|
|
# Get revision used for constructing github URLs
|
|
def get_github_rev():
|
|
path = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip().decode('utf-8')
|
|
try:
|
|
tag = subprocess.check_output(['git', 'describe', '--exact-match']).strip().decode('utf-8')
|
|
except subprocess.CalledProcessError:
|
|
tag = None
|
|
print('Git commit ID: ', path)
|
|
if tag:
|
|
print('Git tag: ', tag)
|
|
return tag
|
|
return path
|