Use shlex.split

This commit is contained in:
Ben Picolo
2017-01-05 10:52:31 -05:00
parent b7bd825e15
commit 54d212f0d7

View File

@@ -3,6 +3,7 @@ from __future__ import unicode_literals
import hashlib
import os
import shlex
from pre_commit import five
from pre_commit.languages import helpers
@@ -82,7 +83,7 @@ def run_hook(repo_cmd_runner, hook, file_args):
# automated cleanup of docker images.
build_docker_image(repo_cmd_runner, pull=False)
entry_parts = hook['entry'].split(' ')
entry_parts = shlex.split(hook['entry'])
entry_executable, entry_args = entry_parts[0], entry_parts[1:]
cmd = (