ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
535 stars 126 forks source link

Add .envrc(direnv) support #160

Closed shinichy closed 1 year ago

shinichy commented 2 years ago

Fixes #102

shinichy commented 2 years ago

@ashald Would you take a look?

cmmoran commented 2 years ago

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...

shinichy commented 2 years ago

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

ashald commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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

ashald commented 1 year ago

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.

shinichy commented 1 year ago

@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.