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 .envrc(direnv) support #160

Closed
wants to merge 12 commits into from
Closed

Add .envrc(direnv) support #160

wants to merge 12 commits into from

Conversation

shinichy
Copy link

@shinichy shinichy commented Oct 25, 2021

Fixes #102

  • Add DirenvProvider to support .envrc file
  • Add getFileNamePredicate and showHiddenFiles methods to EnvVarsProviderFactory interface to allow selecting only .envrc file.

@shinichy
Copy link
Author

@ashald Would you take a look?

@cmmoran
Copy link

cmmoran commented Feb 24, 2022

Incidentally, you don't need to add direnv to /usr/local/bin or any other "pointy" location. Creating a .zprofile (for zsh for example) with proper PATH setup will enable IntelliJ (or any other IDE or Spotlight/Dock launched app from macOS) to obtain a much more usable set of environment variables.

See: MacOS - ZSH: .zprofile, .zshrc, .zlogin...

README.md Outdated Show resolved Hide resolved
@shinichy
Copy link
Author

@ashald Do you have a chance to review this PR?

@ashald
Copy link
Owner

ashald commented Oct 2, 2022

I'd be glad to merge .envrc support, thought this PR breaks abstraction where core module is agnostic of intelij. I might get some time to look into fixing it in November, but if you could update it accordingly it'd help get it merged sooner.

@shinichy
Copy link
Author

shinichy commented Oct 3, 2022

@ashald Thank you for reviewing this PR. I updated this PR not to break the core module abstraction. Would you take a look again?

@ashald
Copy link
Owner

ashald commented Oct 3, 2022

@shinichy ugh, my apologies, I just worked on refactoring some mess in core module to make the interface cleaner. I just submitted a release, and unless there is a critical bug, I don't plan to make any changes to the code. Could you please rebase your changes one more? Apologies for back and forth.

@shinichy
Copy link
Author

shinichy commented Oct 3, 2022

@ashald No worries. I fixed all the conflicts. Could you please take a look again?

@ashald
Copy link
Owner

ashald commented Nov 22, 2022

Hi @shinichy, apologies for a delayed reply.
I was thinking about it for a long time and eventually I realized I would rather not merge in providers that depend on external tools.

What I can offer to you instead is the extension point interface such that you could pack your changes as an independent plugin that relies on extension points provided by EnvFile, but can be installed separately. Please let me know if anything is missing in the current interface that would be necessary for you to implement the above.

P.S.: Alternatively, the latest version of EnvFile can execute any given file and interpret stdout as .env or JSON/YAML. To the best of my understanding, you could wrap a call to direnv in a tiny script that would just output env vars you set.

@ashald ashald closed this Nov 22, 2022
@shinichy
Copy link
Author

@ashald Thanks for letting me know. I don't use IntelliJ and direnv these days, so I'll check your suggestions when I have a chance to use IntelliJ again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to add support for .envrc format
4 participants