mirror of https://github.com/1okko/openpilot.git
parameterize get_version and add get_release_notes function (#31922)
version
This commit is contained in:
parent
4fbc8a3896
commit
018b6d0fae
|
@ -16,12 +16,17 @@ training_version: bytes = b"0.2.0"
|
|||
terms_version: bytes = b"2"
|
||||
|
||||
|
||||
@cache
|
||||
def get_version() -> str:
|
||||
with open(os.path.join(BASEDIR, "common", "version.h")) as _versionf:
|
||||
def get_version(path: str = BASEDIR) -> str:
|
||||
with open(os.path.join(path, "common", "version.h")) as _versionf:
|
||||
version = _versionf.read().split('"')[1]
|
||||
return version
|
||||
|
||||
|
||||
def get_release_notes(path: str = BASEDIR) -> str:
|
||||
with open(os.path.join(path, "RELEASES.md"), "r") as f:
|
||||
return f.read().split('\n\n', 1)[0]
|
||||
|
||||
|
||||
@cache
|
||||
def get_short_version() -> str:
|
||||
return get_version().split('-')[0]
|
||||
|
|
Loading…
Reference in New Issue