mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-13 16:57:35 +00:00
docs: add 'edit-on-github' link to html theme
Closes IDF-1504
This commit is contained in:
15
docs/get_github_rev.py
Normal file
15
docs/get_github_rev.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user