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 1515from  pre_commit .prefix  import  Prefix 
1616from  pre_commit .util  import  clean_path_on_failure 
1717from  pre_commit .util  import  cmd_output_b 
18+ from  pre_commit .util  import  win_exe 
1819
1920ENVIRONMENT_DIR  =  'renv' 
2021RSCRIPT_OPTS  =  ('--no-save' , '--no-restore' , '--no-site-file' , '--no-environ' )
@@ -63,7 +64,7 @@ def _rscript_exec() -> str:
6364    if  r_home  is  None :
6465        return  'Rscript' 
6566    else :
66-         return  os .path .join (r_home , 'bin' , 'Rscript' )
67+         return  os .path .join (r_home , 'bin' , win_exe ( 'Rscript' ) )
6768
6869
6970def  _entry_validate (entry : Sequence [str ]) ->  None :
Original file line number Diff line number Diff line change 66
77from  pre_commit  import  envcontext 
88from  pre_commit .languages  import  r 
9+ from  pre_commit .util  import  win_exe 
910from  testing .fixtures  import  make_config_from_repo 
1011from  testing .fixtures  import  make_repo 
1112from  tests .repository_test  import  _get_hook_no_install 
@@ -133,7 +134,7 @@ def test_r_parsing_file_local(tempdir_factory, store):
133134
134135
135136def  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' ) )
137138    with  envcontext .envcontext ((('R_HOME' , 'r_home_dir' ),)):
138139        assert  r ._rscript_exec () ==  expected 
139140
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments