fix: ensure env patch is applied for vanilla emulation

otherwise, installing the hooks when RENV_USER env variable is set (e.g. in RStudio with renv project) will result in executing the installation script in the wrong renv
This commit is contained in:
Lorenz Walthert 2025-01-19 19:43:24 +01:00 committed by Anthony Sottile
parent cd429db5e2
commit c2c061cf63
2 changed files with 37 additions and 13 deletions

View file

@ -286,7 +286,7 @@ def test_health_check_without_version(prefix, installed_environment, version):
prefix, env_dir = installed_environment
# simulate old pre-commit install by unsetting the installed version
r._execute_vanilla_r_code_as_script(
r._execute_r_in_renv(
f'renv::settings$r.version({version})',
prefix=prefix, version=C.DEFAULT, cwd=env_dir,
)