mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
feat: implement git hash retrieval in __init__.py
This commit is contained in:
parent
aee501d128
commit
8887af5635
1 changed files with 9 additions and 3 deletions
|
@ -2,11 +2,17 @@ __version__ = "0.54.8-dev"
|
|||
|
||||
"""
|
||||
[[[cog
|
||||
# TODO: write python to emit `git_hash = "X"`, where X is the latest 7-char git hash
|
||||
# python goes here
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
git_hash = subprocess.check_output(['git', 'rev-parse', '--short=7', 'HEAD'], universal_newlines=True).strip()
|
||||
except subprocess.CalledProcessError:
|
||||
git_hash = ""
|
||||
|
||||
print(f'git_hash = "{git_hash}"')
|
||||
]]]
|
||||
"""
|
||||
git_hash = "deadbee"
|
||||
git_hash = "deadbee" # This line will be replaced by cog
|
||||
"""
|
||||
[[[end]]]
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue