Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal double quotes in run() command arguments are removed in Windows #12

Open
luciorq opened this issue Oct 6, 2024 · 0 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed Windows

Comments

@luciorq
Copy link
Owner

luciorq commented Oct 6, 2024

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

create_env(packages = c("r-base=4.1.3"), env_name = "condathis-test-env", verbose = "full")

The following Execution behaves normally on Windows:

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.

This example DO 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"
      )
    }
  )
@luciorq luciorq added bug Something isn't working Windows labels Oct 6, 2024
@luciorq luciorq added the help wanted Extra attention is needed label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed Windows
Projects
None yet
Development

No branches or pull requests

1 participant