From 3f8c09108c0dce24c65c7a1125e10a61de20d38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Fri, 24 Oct 2025 09:55:27 +0200 Subject: [PATCH] remove bash -lc --- npm_install.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/npm_install.py b/npm_install.py index 5501301..7cf7424 100644 --- a/npm_install.py +++ b/npm_install.py @@ -841,21 +841,18 @@ 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 "").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 + angie_out = ( + (run_out(["angie", "-v"], check=False) or "") + "\n" + + (run_out(["angie", "-V"], check=False) or "") + ) + m = re.search(r"(?i)\bangie\s*/\s*([0-9]+(?:\.[0-9]+)+)\b", angie_out) + if not m: + dp = (run_out(["dpkg-query", "-W", "-f=${Version}", "angie"], check=False) or "").strip() + m = re.search(r"([0-9]+(?:\.[0-9]+)+)", dp) + angie_v = m.group(1) if m else (angie_out.strip() or "") 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()