mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Change cmd_output_bs retcode arg to a boolean check
This commit is contained in:
parent
71925c47ea
commit
84b38f7b89
15 changed files with 28 additions and 26 deletions
|
|
@ -75,7 +75,7 @@ def in_env(
|
|||
|
||||
def health_check(prefix: Prefix, language_version: str) -> str | None:
|
||||
with in_env(prefix, language_version):
|
||||
retcode, _, _ = cmd_output_b('node', '--version', retcode=None)
|
||||
retcode, _, _ = cmd_output_b('node', '--version', check=False)
|
||||
if retcode != 0: # pragma: win32 no cover
|
||||
return f'`node --version` returned {retcode}'
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ def get_default_version() -> str:
|
|||
# Just detecting the executable does not suffice, because if rustup is
|
||||
# installed but no toolchain is available, then `cargo` exists but
|
||||
# cannot be used without installing a toolchain first.
|
||||
if cmd_output_b('cargo', '--version', retcode=None)[0] == 0:
|
||||
if cmd_output_b('cargo', '--version', check=False)[0] == 0:
|
||||
return 'system'
|
||||
else:
|
||||
return C.DEFAULT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue