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

path_expand cannot find ${USERNAME} #463

Open
ajinkya-k opened this issue Jul 21, 2024 · 0 comments
Open

path_expand cannot find ${USERNAME} #463

ajinkya-k opened this issue Jul 21, 2024 · 0 comments

Comments

@ajinkya-k
Copy link

ajinkya-k commented Jul 21, 2024

When I use path_expand_r("~/") the output I get is:

C:/Users/${USERNAME}

eventhough Sys.getenv("USERNAME") returns the correct value. Even Sys.getenv("R_USER") and Sys.getenv("HOME") have the user directory set correctly.
This causes issues downstream in renv and also usethis::edit_r_profile(). For example, here's the output from a call to the latter:

> usethis::edit_r_profile()
Error: [EPERM] Failed to make directory 'C:/Users/${USERNAME}': operation not permitted

I tried to chase down where this happens and it seems to me that the issue might be in .Call(fs_expand_, path, FALSE). Any idea how to fix this? Am I missing an environment variable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant