question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to set a default environment?

See original GitHub issue

I’ve trouble setting a default environment. I tried your example hook (https://httpyac.github.io/plugins/plugin-api.html#provideenvironmentshook) but this seems to just return a list of possible envs? I thought with that running httpyac test.http -e dev,prev could be simplified to just httpyac test.http. Any advice how else this could be achieved?

As I could see this could be a feature demanded quite often, what about ‘native’ support with sth like:

{
  "$shared": {
    "host": "https://mydoman"
  },
  "$default": "dev",
  "dev": {
    "user": "mario",
    "password": "123456"
  },
  "prod": {
    "user": "mario",
    "password": "password$ecure123"
  }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
AnWebercommented, Nov 30, 2021

The solution would probably be to provide a $default environment in addition to $shared that is loaded when no environment is present.

1reaction
AnWebercommented, Nov 29, 2021

provideEnvironments is needed to allow selection of environments in VSCode. provideVariables is the hook you need. You get current environment selection and can fill your defaults if no env is selected (undefined or empty array) https://httpyac.github.io/plugins/plugin-api.html#providevariableshook

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change default Anaconda python environment
Open anaconda prompt & use 'conda env list' to find the location of the environment you wish to use. · Go to the...
Read more >
Manage the default environment - Power Platform
Create a solution and add the app and all its dependencies to it. The dependencies include the apps, flows, and tables. The solution...
Read more >
What Are the Default Environment Variables in Windows?
What are the default environment variables in Windows? ... Viewing environment variables with the SET command. In Microsoft Windows, environment ...
Read more >
How do you set the default environment in Anaconda Navigator?
Right click on you my computer and open properties · Open advanced system settings and click on Environmental Variables · Now select the...
Read more >
Setting up a default project environment
Create a new conda environment in the /opt/wakari/anaconda/envs/default directory. EXAMPLE: Using a Python 3.4 base environment, run: · Use conda to install any ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found