mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
fix for node healthy() when system executable moves
This commit is contained in:
parent
f511afe40e
commit
b149c7a344
2 changed files with 41 additions and 3 deletions
|
|
@ -21,7 +21,6 @@ from pre_commit.util import cmd_output
|
|||
from pre_commit.util import cmd_output_b
|
||||
|
||||
ENVIRONMENT_DIR = 'node_env'
|
||||
healthy = helpers.basic_healthy
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=1)
|
||||
|
|
@ -73,6 +72,12 @@ def in_env(
|
|||
yield
|
||||
|
||||
|
||||
def healthy(prefix: Prefix, language_version: str) -> bool:
|
||||
with in_env(prefix, language_version):
|
||||
retcode, _, _ = cmd_output_b('node', '--version', retcode=None)
|
||||
return retcode == 0
|
||||
|
||||
|
||||
def install_environment(
|
||||
prefix: Prefix, version: str, additional_dependencies: Sequence[str],
|
||||
) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue