mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
xargs returns nonzero for negate + not found exe (fixes pcre + not found #447)
This commit is contained in:
parent
0e2c3c1ff9
commit
a157e1a63f
7 changed files with 49 additions and 11 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from pre_commit import parse_shebang
|
||||
from pre_commit.util import cmd_output
|
||||
|
||||
|
||||
|
|
@ -52,6 +53,11 @@ def xargs(cmd, varargs, **kwargs):
|
|||
stdout = b''
|
||||
stderr = b''
|
||||
|
||||
try:
|
||||
parse_shebang.normexe(cmd[0])
|
||||
except parse_shebang.ExecutableNotFoundError as e:
|
||||
return e.to_output()
|
||||
|
||||
for run_cmd in partition(cmd, varargs, **kwargs):
|
||||
proc_retcode, proc_out, proc_err = cmd_output(
|
||||
*run_cmd, encoding=None, retcode=None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue