File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import io
55import os .path
6+ import pipes
67import sys
78
89from pre_commit import output
@@ -68,7 +69,7 @@ def install(
6869
6970 skip_on_missing_conf = 'true' if skip_on_missing_conf else 'false'
7071 contents = io .open (resource_filename ('hook-tmpl' )).read ().format (
71- sys_executable = sys .executable ,
72+ sys_executable = pipes . quote ( sys .executable ) ,
7273 hook_type = hook_type ,
7374 hook_specific = hook_specific_contents ,
7475 config_file = runner .config_file ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ popd > /dev/null
99retv=0
1010args=" "
1111
12- ENV_PYTHON=' {sys_executable}'
12+ ENV_PYTHON={sys_executable}
1313SKIP_ON_MISSING_CONF={skip_on_missing_conf}
1414
1515which pre-commit >& /dev/null
Original file line number Diff line number Diff line change 44
55import io
66import os .path
7+ import pipes
78import re
89import shutil
910import subprocess
@@ -54,7 +55,7 @@ def test_install_pre_commit(tempdir_factory):
5455 pre_commit_contents = io .open (runner .pre_commit_path ).read ()
5556 pre_commit_script = resource_filename ('hook-tmpl' )
5657 expected_contents = io .open (pre_commit_script ).read ().format (
57- sys_executable = sys .executable ,
58+ sys_executable = pipes . quote ( sys .executable ) ,
5859 hook_type = 'pre-commit' ,
5960 hook_specific = '' ,
6061 config_file = runner .config_file ,
@@ -70,7 +71,7 @@ def test_install_pre_commit(tempdir_factory):
7071 pre_push_tmpl = resource_filename ('pre-push-tmpl' )
7172 pre_push_template_contents = io .open (pre_push_tmpl ).read ()
7273 expected_contents = io .open (pre_commit_script ).read ().format (
73- sys_executable = sys .executable ,
74+ sys_executable = pipes . quote ( sys .executable ) ,
7475 hook_type = 'pre-push' ,
7576 hook_specific = pre_push_template_contents ,
7677 config_file = runner .config_file ,
You can’t perform that action at this time.
0 commit comments