Skip to content

Commit

Permalink
only append .exe suffix on Windows if the executable is called with t…
Browse files Browse the repository at this point in the history
…he full path
  • Loading branch information
lorenzwalthert committed Nov 25, 2022
1 parent 2b8c580 commit c0716c0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pre_commit/languages/r.py
Expand Up @@ -62,11 +62,10 @@ def _prefix_if_non_local_file_entry(

def _rscript_exec() -> str:
r_home = os.environ.get('R_HOME')
program = win_exe(RSCRIPT_PROGRAM)
if r_home is None:
return program
return RSCRIPT_PROGRAM
else:
return os.path.join(r_home, 'bin', program)
return os.path.join(r_home, 'bin', win_exe(RSCRIPT_PROGRAM))


def _entry_validate(entry: Sequence[str]) -> None:
Expand Down

0 comments on commit c0716c0

Please sign in to comment.