mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
fix "--version": needs to change working directory
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
This commit is contained in:
parent
00dbc195ac
commit
08748dd021
|
@ -3,11 +3,13 @@ __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).decode("utf-8").rstrip().strip('"')
|
||||
stderr=subprocess.DEVNULL, cwd=freqtrade_basedir).decode("utf-8").rstrip().strip('"')
|
||||
|
||||
except Exception: # pragma: no cover
|
||||
# git not available, ignore
|
||||
|
|
Loading…
Reference in New Issue
Block a user