mirror of https://github.com/zulip/zulip.git
zulip_tools: Shell out to python to get true ZULIP_VERSION.
Parsing veryion.py will not get extended version information from git.
This commit is contained in:
parent
41aadc8c63
commit
418e51cc5b
|
@ -108,10 +108,13 @@ def get_deploy_root() -> str:
|
|||
|
||||
|
||||
def parse_version_from(deploy_path: str) -> str:
|
||||
with open(os.path.join(deploy_path, "version.py")) as f:
|
||||
result = re.search('ZULIP_VERSION = "(.*)"', f.read())
|
||||
if result:
|
||||
return result.groups()[0]
|
||||
try:
|
||||
return subprocess.check_output(
|
||||
[sys.executable, "-c", "from version import ZULIP_VERSION; print(ZULIP_VERSION)"],
|
||||
cwd=deploy_path,
|
||||
text=True,
|
||||
).strip()
|
||||
except subprocess.CalledProcessError:
|
||||
return "0.0.0"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue