Fix filenames with spaces in them.

This commit is contained in:
Anthony Sottile 2014-06-20 10:20:02 -07:00
parent 061ac81682
commit 2ec7a34035
8 changed files with 25 additions and 7 deletions

View file

@ -2,12 +2,12 @@ from __future__ import unicode_literals
def file_args_to_stdin(file_args):
return '\n'.join(list(file_args) + [''])
return '\0'.join(list(file_args) + [''])
def run_hook(env, hook, file_args):
return env.run(
' '.join(['xargs', hook['entry']] + hook['args']),
' '.join(['xargs', '-0', hook['entry']] + hook['args']),
stdin=file_args_to_stdin(file_args),
retcode=None,
)