Specify syntax of using existing environment variables in .env file
See original GitHub issueIssue Type: Bug
I’ve been looking at the docs and I think there needs to be some clarification, or there is a bug:
According to the docs, variables in .env file can be substituted by usage of <VARIABLE>=...${EXISTING_VARIABLE}...
syntax.
As I have discovered, this works for variables defined previously in the .env file, but not for system environment variables. System env variables need following syntax (tested): <VARIABLE>=...${env:EXISTING_SYSTEM_ENV_VARIABLE}...
Can you please specify how it should be, and update the docs?
Extension version: 2019.11.50794 VS Code version: Code 1.41.0 (9579eda04fdb3a9bba2750f15193e5fafe16b959, 2019-12-11T18:37:42.077Z) OS version: Windows_NT x64 10.0.18362
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ i5-4570 CPU @ 3.20GHz (4 x 3193) |
GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled metal: disabled_off multiple_raster_threads: enabled_on oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_renderer: disabled_off surface_control: disabled_off surface_synchronization: enabled_on video_decode: enabled viz_display_compositor: enabled_on viz_hit_test_surface_layer: disabled_off webgl: enabled webgl2: enabled |
Load (avg) | undefined |
Memory (System) | 15.89GB (6.49GB free) |
Process Argv | L:\commonPyLibs\commonPyLibsPresentation.code-workspace |
Screen Reader | no |
VM | 0% |
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
How To Use Environment Files with env-cmd | DigitalOcean
Learn how to add handle environment variables with the env-cmd package.
Read more >Environment variables in Compose | Docker Documentation
You can set default values for environment variables using a .env file, ... Similarly, the following syntax allows you to specify mandatory variables:....
Read more >Set environment variables from file of key/value pairs
This solves the potential problem when going from project to project. env $(cat .env | xargs) rails. I've tested this with bash 3.2....
Read more >What is .env ? How to Set up and run a .env file in Node?
Environment variables must be used to configure any variables or configuration details that may differ between environments.
Read more >Working with Environment Variables in Python - Twilio
But if you cannot commit the .env file, how do you tell users of the project which variables need to be set? For...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s a Windows batch file scrip, not a
.env
file. I’m referring to just a regular.env
file.To my knowledge
.env
files with support for nested variables doesn’t exist in the most popular php, python and node packages (packages that support loading variables from.env
files), including bash script with support for auto loading such variables. Hence my assumption about these being non-standard in.env
files.Please understand I’m not saying we should remove it. It’s a feature that exists in the extension today, and won’t be removed. I was merely expressing my opinion about this feature.
Looks like this is a bug in the extension.
For repro this should work:
test_env.py:
launch.json:
expected output:
actual output