diff --git a/aider/__init__.py b/aider/__init__.py index b1dde9da7..18d45a4dc 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1,22 +1,21 @@ __version__ = "0.54.8-dev" -""" -[[[cog +"""[[[cog import subprocess try: - git_hash = subprocess.check_output(['git', 'rev-parse', '--short=7', 'HEAD'], universal_newlines=True).strip() + git_hash = subprocess.check_output( + ['git', 'rev-parse', '--short=7', 'HEAD'], + universal_newlines=True, + ).strip() except subprocess.CalledProcessError: - git_hash = "" + git_hash = None -print(f'git_hash = "{git_hash}"') -]]] -""" -git_hash = "deadbee" # This line will be replaced by cog -""" -[[[end]]] -""" +cog.out(f'git_hash = "{git_hash}"') +]]]""" +git_hash = "3fcb9e2" +"""[[[end]]]""" -if '-dev' in __version__: +if "-dev" in __version__ and git_hash: xyz = __version__.split("-")[0] __version__ = xyz + "-dev+" + git_hash diff --git a/scripts/update-docs.sh b/scripts/update-docs.sh index 191f39382..c8c450822 100755 --- a/scripts/update-docs.sh +++ b/scripts/update-docs.sh @@ -21,3 +21,7 @@ cog $ARG \ aider/website/docs/config/aider_conf.md \ aider/website/docs/leaderboards/index.md \ aider/website/docs/llms/other.md + + +cog -r aider/__init__.py && git add aider/__init__.py && git commit -m "updating version hash" +