-
Notifications
You must be signed in to change notification settings - Fork 12
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
Load specified envrc #553
Load specified envrc #553
Conversation
…and palette and explorer context menu (right-click a .envrc file).
I'm still a bit on the fence about this. Have you tried using multi-root workspaces for tihs use case? |
No, I haven't tried multi-root workspaces yet. Thanks for the hint.
I also observed, that the terminal unloads the custom environment, but I don't think that is a problem:
|
I did a tiny bit of cleanup and merged it. |
Use case
Consider a project setup like this:
I would like to develop
pkgs/important_pkg
and look at thedocs/important_pkg.html
at the same time, becauseimportant_pkg
is very complex. Also I would like to extend the documentation while developing.Additionally I would like to switch easily between the development environments of
important_pkg
andalso_important_pkg
because those depend on each other. Unfortunately I can't use the same.envrc
for both, as they need different environments.Approach
Unfortunately
direnv
is only capable of loading.envrc
files which are located in the current working directory. The solution is to let the user specify, which.envrc
file they wish to load, and then rundirenv dump
in the directory of this.envrc
file.The user may specify the
.envrc
file via the explorer context menu. Alternatively, if the command is called from the Command Palette the user may choose the file using anOpenDialog
.The statusbar is complemented to show the name of the folder in which the
.envrc
is located. This is to avoid confusion with multiple development environmentsImportant notes
*.md
files have been complemented, but I don't know if that's enough of documentation.What do you think about this?