mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 02:12:01 +00:00
08748dd021
before calling `git`. otherwise it would display git commit id from the directory where you are calling `freqtrade` from instead of freqtrade's current commit id
24 lines
861 B
Python
24 lines
861 B
Python
""" Freqtrade bot """
|
|
__version__ = '2023.1.dev'
|
|
|
|
if 'dev' in __version__:
|
|
try:
|
|
import os
|
|
import subprocess
|
|
freqtrade_basedir = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
__version__ = __version__ + '-' + subprocess.check_output(
|
|
['git', 'log', '--format="%h"', '-n 1'],
|
|
stderr=subprocess.DEVNULL, cwd=freqtrade_basedir).decode("utf-8").rstrip().strip('"')
|
|
|
|
except Exception: # pragma: no cover
|
|
# git not available, ignore
|
|
try:
|
|
# Try Fallback to freqtrade_commit file (created by CI while building docker image)
|
|
from pathlib import Path
|
|
versionfile = Path('./freqtrade_commit')
|
|
if versionfile.is_file():
|
|
__version__ = f"docker-{__version__}-{versionfile.read_text()[:8]}"
|
|
except Exception:
|
|
pass
|