Skip to content

Commit c68ef12

Browse files
committed
fixed path to binary
1 parent b271060 commit c68ef12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pre_commit/languages/swift.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from pre_commit.languages import helpers
66
from pre_commit.util import clean_path_on_failure
7-
from pre_commit.util import cwd
87
from pre_commit.xargs import xargs
98

109
ENVIRONMENT_DIR = 'swift_env'
@@ -36,5 +35,6 @@ def run_hook(repo_cmd_runner, hook, file_args):
3635
directory = repo_cmd_runner.path(helpers.environment_dir(
3736
ENVIRONMENT_DIR, 'default',
3837
))
39-
with(cwd(os.path.join(directory, BUILD_DIR, BUILD_CONFIG))):
40-
return xargs(helpers.to_cmd(hook), file_args)
38+
cmd = helpers.to_cmd(hook)
39+
full_binary_path = os.path.join(directory, BUILD_DIR, BUILD_CONFIG, cmd[0])
40+
return xargs((full_binary_path,) + cmd[1:], file_args)

0 commit comments

Comments
 (0)