Allow spaces in system hooks. Closes #95.

This commit is contained in:
Anthony Sottile
2014-05-18 14:20:11 -07:00
parent 53e316ade4
commit 61606cfaa4
5 changed files with 28 additions and 12 deletions

View File

@@ -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,