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

Add an option to search for .envrc in parent directories. #65

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dshatz
Copy link

@dshatz dshatz commented Oct 16, 2024

As far as I understand, this is default behavior of direnv anyway so should be logical to have this in the plugin.
I added a settings entry which defaults to false as well.
image

Also notification ".envrc found" now includes the path of the file
image

Tested on a setup like described in #64

Also tested on a a project with no .envrc anywhere in the parent directories (the plugin is then looking up everything until it reaches /). Nothing crashes, this in the logs:

2024-10-16 16:02:56,528 [   9977]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning /home/dshatz/dev/test-no-envrc directory for .envrc
2024-10-16 16:02:56,529 [   9978]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning /home/dshatz/dev directory for .envrc
2024-10-16 16:02:56,533 [   9982]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning /home/dshatz directory for .envrc
2024-10-16 16:02:56,561 [  10010]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning /home directory for .envrc
2024-10-16 16:02:56,567 [  10016]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Scanning / directory for .envrc
2024-10-16 16:02:56,574 [  10023]  FINER - #systems.fehn.intellijdirenv.services.DirenvProjectService - Project test-no-envrc contains no .envrc file

@dshatz
Copy link
Author

dshatz commented Oct 16, 2024

Now I'm thinking - maybe a better approach is to parse direnv status.

Loaded RC path /home/dshatz/dev/boxes/python/.envrc

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.

1 participant