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

Does not resolve Environment Variables #9

Open
ju6ge opened this issue Jul 5, 2022 · 1 comment
Open

Does not resolve Environment Variables #9

ju6ge opened this issue Jul 5, 2022 · 1 comment

Comments

@ju6ge
Copy link

ju6ge commented Jul 5, 2022

Hey,

one of the nice features of environment files is that they can build upon the existing environment:

export SEARCH_DIR=$PWD/files

The expected behavior would be that the resulting SEARCH_DIR environment variable would contain the full path to the desired directory. Instead the result is "$PWD/files". Without this feature .env files are utterly useless when developing code on different machines with different directory structures, because one needs to manually adjust the file for every machine.

Kind regards,
ju6ge

@vikjam
Copy link

vikjam commented Jul 23, 2022

I think this package relies upon Sys.setenv. However, from what I can tell, it's not possible to get Sys.setenv to expand $PWD. See this discussion on the RStudio forum.

In order to solve this, I think one would need to parse the contents of .env to get each $ reference. Then you could reassemble the contents with Sys.getenv evaluating each $ reference. Not sure if that'd slow things down too much or risk creating other bugs.

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

2 participants