File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 15
15
from pre_commit .prefix import Prefix
16
16
from pre_commit .util import clean_path_on_failure
17
17
from pre_commit .util import cmd_output_b
18
+ from pre_commit .util import win_exe
18
19
19
20
ENVIRONMENT_DIR = 'renv'
20
21
RSCRIPT_OPTS = ('--no-save' , '--no-restore' , '--no-site-file' , '--no-environ' )
@@ -63,7 +64,7 @@ def _rscript_exec() -> str:
63
64
if r_home is None :
64
65
return 'Rscript'
65
66
else :
66
- return os .path .join (r_home , 'bin' , 'Rscript' )
67
+ return os .path .join (r_home , 'bin' , win_exe ( 'Rscript' ) )
67
68
68
69
69
70
def _entry_validate (entry : Sequence [str ]) -> None :
Original file line number Diff line number Diff line change 6
6
7
7
from pre_commit import envcontext
8
8
from pre_commit .languages import r
9
+ from pre_commit .util import win_exe
9
10
from testing .fixtures import make_config_from_repo
10
11
from testing .fixtures import make_repo
11
12
from tests .repository_test import _get_hook_no_install
@@ -133,7 +134,7 @@ def test_r_parsing_file_local(tempdir_factory, store):
133
134
134
135
135
136
def test_rscript_exec_relative_to_r_home ():
136
- expected = os .path .join ('r_home_dir' , 'bin' , 'Rscript' )
137
+ expected = os .path .join ('r_home_dir' , 'bin' , win_exe ( 'Rscript' ) )
137
138
with envcontext .envcontext ((('R_HOME' , 'r_home_dir' ),)):
138
139
assert r ._rscript_exec () == expected
139
140
You can’t perform that action at this time.
0 commit comments