The handling of internal quotes passed to run() arguments looks different on Windows and Linux/Unix, needs to investigate more.
Currently it was found because it breaks one test defined in: Env Var test
library(condathis )
create_env(packages = c(" r-base=4.1.3" ), env_name = " condathis-test-env" , verbose = " full" )
The following Execution behaves normally on Windows:
Important
This Example works on Windows
withr :: with_envvar(
new = list (`MY_VAR_1` = " HELLO FROM OUTSIDE" ),
code = {
px_res <- run(
" R" , " -q" , " -s" , " -e" , " print(Sys.getenv('MY_VAR_1'))" ,
env_name = " condathis-test-env" ,
verbose = " full"
)
}
)
But replacing the internal quotes of "print(Sys.getenv('MY_VAR_1'))" for 'print(Sys.getenv("MY_VAR_1"))', breaks on windows.
Caution
The following example DOES NOT work on windows
withr :: with_envvar(
new = list (`MY_VAR_1` = " HELLO FROM OUTSIDE" ),
code = {
px_res <- run(
" R" , " -q" , " -s" , " -e" , ' print(Sys.getenv("MY_VAR_1"))' ,
env_name = " condathis-test-env" ,
verbose = " full"
)
}
)
The handling of internal quotes passed to
run()arguments looks different on Windows and Linux/Unix, needs to investigate more.Currently it was found because it breaks one test defined in: Env Var test
The following Execution behaves normally on Windows:
Important
This Example works on Windows
But replacing the internal quotes of
"print(Sys.getenv('MY_VAR_1'))"for'print(Sys.getenv("MY_VAR_1"))', breaks on windows.Caution
The following example DOES NOT work on windows