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

VS Code debugger should be able to use an external file for environment setup #14523

Closed
mariosant opened this issue Oct 26, 2016 · 9 comments
Closed
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality
Milestone

Comments

@mariosant
Copy link

mariosant commented Oct 26, 2016

Issue:
I am looking for ways to load a .env file into debugger environment.

launch.json provides an env section, where you can define such variables. In typical use cases, launch.json is being version controlled though, forbidding adding sensitive data, such as api keys.

Expectation:
It would be really helpful, if there was a syntax like the following example:

"env" : "${workspaceRoot}.env"

Not sure where to mention that, this is a FEATURE REQUEST.

@weinand weinand self-assigned this Oct 26, 2016
@weinand weinand added feature-request Request for new features or functionality debug Debug viewlet, configurations, breakpoints, adapter issues labels Oct 26, 2016
@weinand
Copy link
Contributor

weinand commented Oct 26, 2016

@mariosant loading from a file would be in addition to the existing "env" attribute and not a replacement, right? So you could load some env vars from a file and add more variables to that in the launch.json.

@weinand weinand added this to the November 2016 milestone Oct 26, 2016
@mariosant
Copy link
Author

That is correct, @weinand. Loading from env file, should add to current environment. It should not replace it.

Loading vars from a file and adding more variables to launch.json, would be awesome!

@weinand
Copy link
Contributor

weinand commented Oct 26, 2016

Is it necessary to support loading multiple env files or is one typically enough?

@mariosant
Copy link
Author

Most cases, a single .env file exists. I believe this is the most common use case, IMHO.

Ruby users typically use: https://github.com/bkeepers/dotenv to handle it.
Nodejs users use: https://github.com/motdotla/dotenv to handle it.

Not very sure about other ones :)

@weinand
Copy link
Contributor

weinand commented Nov 10, 2016

@roblourens fyi, another feature for node-debug2

@weinand
Copy link
Contributor

weinand commented Nov 10, 2016

@mariosant you can now use an attribute envFile in a launch config to specify a file containing environment variable definitions (should become available in Friday's Insiders build).

@mariosant
Copy link
Author

This is great to hear! I will surely check it out @weinand.

@ancashoria
Copy link

@weinand This functionality is also needed for tasks.json and would allow complete removal of env variables from source code.
Is it available somewhere and I'm not finding it?

Thanks

@weinand
Copy link
Contributor

weinand commented Jul 21, 2017

@ancashoria please create a new issue against tasks for this.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants