mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Allow spaces in system hooks. Closes #95.
This commit is contained in:
parent
53e316ade4
commit
61606cfaa4
5 changed files with 28 additions and 12 deletions
|
|
@ -1,3 +1,6 @@
|
|||
import shlex
|
||||
|
||||
|
||||
ENVIRONMENT_DIR = None
|
||||
|
||||
|
||||
|
|
@ -7,7 +10,7 @@ def install_environment(repo_cmd_runner):
|
|||
|
||||
def run_hook(repo_cmd_runner, hook, file_args):
|
||||
return repo_cmd_runner.run(
|
||||
['xargs', hook['entry']] + hook['args'],
|
||||
['xargs'] + shlex.split(hook['entry']) + hook['args'],
|
||||
# TODO: this is duplicated in pre_commit/languages/helpers.py
|
||||
stdin='\n'.join(list(file_args) + ['']),
|
||||
retcode=None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue