summaryrefslogtreecommitdiffstats
path: root/pre_commit/languages/node.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-19 07:00:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-19 07:00:25 +0000
commita5907b904f568d3249b7629ea9ff3b932f723ce3 (patch)
treeb82c427c125ea5fcf9d1e2fb48e4a529fc932fba /pre_commit/languages/node.py
parentAdding upstream version 2.18.1. (diff)
downloadpre-commit-a5907b904f568d3249b7629ea9ff3b932f723ce3.tar.xz
pre-commit-a5907b904f568d3249b7629ea9ff3b932f723ce3.zip
Adding upstream version 2.19.0.upstream/2.19.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/languages/node.py')
-rw-r--r--pre_commit/languages/node.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pre_commit/languages/node.py b/pre_commit/languages/node.py
index b084e8f..39f3000 100644
--- a/pre_commit/languages/node.py
+++ b/pre_commit/languages/node.py
@@ -73,10 +73,13 @@ def in_env(
yield
-def healthy(prefix: Prefix, language_version: str) -> bool:
+def health_check(prefix: Prefix, language_version: str) -> str | None:
with in_env(prefix, language_version):
retcode, _, _ = cmd_output_b('node', '--version', retcode=None)
- return retcode == 0
+ if retcode != 0: # pragma: win32 no cover
+ return f'`node --version` returned {retcode}'
+ else:
+ return None
def install_environment(