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

Feature/read multiple env files #2578

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

minamz
Copy link

@minamz minamz commented Jul 8, 2024

Description

Enables loading multiple <named>.env files from the collection folder, instead of only the .env file.
Use case: I have a project which reads vars from multiple named .env files, and trying to integrate the project with Bruno; and wanted Bruno to access the multiple env files for experimentation/integration.

I think it should be somewhat related to, although not exactly a completion of, an existing issue : #409

Below images illustrate how variables are loaded to Bruno from 2 separate env files: .env and localBru.env which are at the collection level.
Also the values are reloaded whenever files are changed and saved.

image image image image image image image

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

@minamz minamz marked this pull request as ready for review July 8, 2024 12:41
@gheiler-on
Copy link

I think in order to solve #409 it should be possible to add a hierarchy, given you will have the same keys in different files, and you wan to be in control of which files should have preponderance over the other ones.
For that I don't see any other way more than adding a UI piece where you will select per environment which .env files to load on which sequence.
Just adding, in case you also want to support that issue, given I would be interested on it :)

@minamz
Copy link
Author

minamz commented Aug 15, 2024

@gheiler-on thanks for the input; ~ 💚 i totally agree with that; didn't really have a solution for duplicate keys as in my use case they were unique...
ideally it would be possible to set a global env file, then set a specific env file for a collection; which would take priority over the global one, and so on.
sadly i'm not so much skilled on frontend at the moment so as to achieve that (but slowly learning ... 🥹 )

@helloanoop helloanoop self-assigned this Sep 22, 2024
@helloanoop helloanoop assigned ramki-bruno and unassigned helloanoop Jan 13, 2025
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

Successfully merging this pull request may close these issues.

4 participants