Use Hook api in languages

This commit is contained in:
Anthony Sottile 2018-12-31 13:16:48 -08:00
parent 5f9a667470
commit b59d7197ff
18 changed files with 41 additions and 38 deletions

View file

@ -85,15 +85,15 @@ def docker_cmd():
)
def run_hook(prefix, hook, file_args): # pragma: windows no cover
def run_hook(hook, file_args): # pragma: windows no cover
assert_docker_available()
# Rebuild the docker image in case it has gone missing, as many people do
# automated cleanup of docker images.
build_docker_image(prefix, pull=False)
build_docker_image(hook.prefix, pull=False)
hook_cmd = helpers.to_cmd(hook)
entry_exe, cmd_rest = hook_cmd[0], hook_cmd[1:]
entry_tag = ('--entrypoint', entry_exe, docker_tag(prefix))
entry_tag = ('--entrypoint', entry_exe, docker_tag(hook.prefix))
cmd = docker_cmd() + entry_tag + cmd_rest
return helpers.run_xargs(hook, cmd, file_args)