From eec68fd4347e35ac5b14e1287cb1a0d1add0783c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Fri, 24 Oct 2025 09:53:00 +0200 Subject: [PATCH] remove bash -lc --- npm_install.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/npm_install.py b/npm_install.py index 6372c1a..5501301 100644 --- a/npm_install.py +++ b/npm_install.py @@ -841,13 +841,25 @@ def create_systemd_units(ipv6_enabled: bool): def gather_versions(npm_app_version: str): _ips = run_out(["hostname", "-I"], check=False) or "" ip = (_ips.split() or [""])[0] - _angie = run_out(["angie", "-v"], check=False) or "" - m = re.search(r"\d+(?:\.\d+)+", _angie) - angie_v = m.group(0) if m else _angie.strip() + _angie = (run_out(["angie", "-v"], check=False) or "").strip() + angie_v = "" + 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") yarn_v = (run_out(["yarn", "-v"], check=False) or "").strip() if not yarn_v: yarn_v = (run_out(["yarnpkg", "-v"], check=False) or "").strip() + return ip, angie_v, node_v, yarn_v, npm_app_version def update_motd(enabled: bool, info, ipv6_enabled: bool):