use Rscript path relative to $R_HOME/bin/...#2301
Conversation
|
This currently does not work because we also need to account for the fact that To be true to the name of the |
|
Of course! Sorry I missed that. I'll put together something more thorough along those lines. |
|
Cool. Let me know if you need help. Also, we should rename the function from pre_commit.languages.r import in_env, _path_rscript_exec
from pre_commit.envcontext import envcontext
@pytest.mark.parametrize(('r_home_env', 'rscript_path_expected') [("/usr/bin/local", "/user/bin/local/Rscript"), (UNSET, 'location is os specific: get it dynamically)])
def test_path_rscript_exec(r_home_env, rscript_path_expected):
with in_env(hook.prefix, hook.language_version):
with envcontext(("R_HOME", r_home_env)):
assert _path_rscript_exec() == rscript_path_expectedIf it gives an error or takes too long to create a test, I can figure that out later. |
|
Actually we should not really need |
Co-authored-by: Lorenz Walthert <lorenz.walthert@icloud.com>
|
I went ahead and added that test and adjusted the code |
|
thank you, seems to work. |
I'm not familiar enough with developing pre-commit to know how to test out my branch in the same environment where I experienced the bug, but I would be happy to do so with a little more guidance.
I believe this fixes the Rscript path issue I noticed using the built-in Terminal from RStudio Server on Ubuntu.