vscode-restclient
vscode-restclient copied to clipboard
[Feature] add support for vscode env in dotenv
This PR allows the users to create .env files for each environment that exists within their vscode settings.
Behavior: When walking back up the path, when either .env or .env.{vscode-env} is found, stop and prefer .env.{vscode-env}.
Use case: I want to specify an auth token in gitignored env files because the repo's settings.json is checked into source control already so we cannot place them in there safely.
Closes https://github.com/Huachao/vscode-restclient/issues/740
Will this read the .env file in the root of code that's currently open?
@nicksmider merged, thanks
Wondering, why there is not a dotenv module used? It does the same and pretty much all frameworks using it
@FDiskas the dotenv is already used by the project
Based on the use case outlined by @nicksmider I think a better approach would be to first load the .env file and then load values from .env.local as overrides. From the description it sounds like users will need to copy all values from the .env file and now there are two things to maintain.
@FDiskas the
dotenvis already used by the project
But why then env file loading is done manually? https://www.npmjs.com/package/dotenv#should-i-have-multiple-env-files