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

Environment switch does not seem to work #341

Open
archwizmgm opened this issue Nov 18, 2024 · 3 comments
Open

Environment switch does not seem to work #341

archwizmgm opened this issue Nov 18, 2024 · 3 comments

Comments

@archwizmgm
Copy link

When I switch environment to local.env, it seems that my_env is still reading from .env.

image

I tried httpyac-cli, and it works fine.

httpyac -e local -all .\test.http

Version info

vscode: 1.95.3 (user setup)
vscode-httpyac: v6.16.4
httpyac-cli: 6.16.4
os: windows 11

Dotenv files

.env

my_env=foo

local.env

my_env=bar

Requst

test.http

@my_env={{my_env}}

{{
    console.info(my_env);
}}
GET https://catfact.ninja/fact
@fmv1992
Copy link

fmv1992 commented Nov 21, 2024

The documentation for how --env works is lacking. local.env is ignored.

I got it to work with .env.

It would be great if I didn't have to serialize any secret for it to work. It should have an option to read the env vars instead.

@AnWeber
Copy link
Owner

AnWeber commented Nov 21, 2024

local.env should work. This feature I am using in my default setup.
The problem in the example I am not sure if it is an order problem with the environments. Shouldn't really be, because I use that too. Strange is the first line which basically sets a=a. But I doubt whether this is reason. I need a pc for this, but I have currently given myself a private coding ban. Coding at work is too exhausting. Maybe next week.

@archwizmgm
Copy link
Author

local.env should work. This feature I am using in my default setup. The problem in the example I am not sure if it is an order problem with the environments. Shouldn't really be, because I use that too. Strange is the first line which basically sets a=a. But I doubt whether this is reason. I need a pc for this, but I have currently given myself a private coding ban. Coding at work is too exhausting. Maybe next week.

Yes,Coding is really tiring. You should take a break.

I changed the first line, problem still there.

2024-11-22 16-39-39
2024-11-22 16-42-33

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

3 participants