remove bash -lc
This commit is contained in:
@@ -841,13 +841,25 @@ def create_systemd_units(ipv6_enabled: bool):
|
|||||||
def gather_versions(npm_app_version: str):
|
def gather_versions(npm_app_version: str):
|
||||||
_ips = run_out(["hostname", "-I"], check=False) or ""
|
_ips = run_out(["hostname", "-I"], check=False) or ""
|
||||||
ip = (_ips.split() or [""])[0]
|
ip = (_ips.split() or [""])[0]
|
||||||
_angie = run_out(["angie", "-v"], check=False) or ""
|
_angie = (run_out(["angie", "-v"], check=False) or "").strip()
|
||||||
m = re.search(r"\d+(?:\.\d+)+", _angie)
|
angie_v = ""
|
||||||
angie_v = m.group(0) if m else _angie.strip()
|
for pat in (
|
||||||
|
r"(?i)\bangie\s*/\s*(\d+(?:\.\d+)+)\b",
|
||||||
|
r"(?i)\bangie\s+version:\s*angie/\s*(\d+(?:\.\d+)+)\b",
|
||||||
|
):
|
||||||
|
m = re.search(pat, _angie)
|
||||||
|
if m:
|
||||||
|
angie_v = m.group(1)
|
||||||
|
break
|
||||||
|
if not angie_v:
|
||||||
|
m = re.search(r"\b\d+(?:\.\d+)+\b", _angie)
|
||||||
|
angie_v = m.group(0) if m else _angie
|
||||||
|
|
||||||
node_v = (run_out(["node", "-v"], check=False) or "").strip().lstrip("v")
|
node_v = (run_out(["node", "-v"], check=False) or "").strip().lstrip("v")
|
||||||
yarn_v = (run_out(["yarn", "-v"], check=False) or "").strip()
|
yarn_v = (run_out(["yarn", "-v"], check=False) or "").strip()
|
||||||
if not yarn_v:
|
if not yarn_v:
|
||||||
yarn_v = (run_out(["yarnpkg", "-v"], check=False) or "").strip()
|
yarn_v = (run_out(["yarnpkg", "-v"], check=False) or "").strip()
|
||||||
|
|
||||||
return ip, angie_v, node_v, yarn_v, npm_app_version
|
return ip, angie_v, node_v, yarn_v, npm_app_version
|
||||||
|
|
||||||
def update_motd(enabled: bool, info, ipv6_enabled: bool):
|
def update_motd(enabled: bool, info, ipv6_enabled: bool):
|
||||||
|
|||||||
Reference in New Issue
Block a user