EnvFile
EnvFile copied to clipboard
Run EnvFile after External tool
Firstly, thank you for developing this useful plugin!
I'm using a script to generate an environment file for use with EnvFile, so that I can dynamically change environment variables based on my system (e.g. IP address). In my run configuration, I've set up an "External tool" to run my script before launch and create the file for use by the EnvFile plugin. However, this does not work. It appears EnvFile is triggered before my "Before launch: External tool" job is run, so EnvFile fails to find the file which my script creates.
Thank you for kind words!
I clearly understand your use case but from the top of my head I do not have any ideas how EnvFile can support it. The problem is that EnvFile relies on standard plugin interface exposed by JetBrains' "language support plugins" and therefore it does not have control over exactly it should be reading files with environment variables.
The only idea that I have that is rather a workaround is using a Compound
run configuration type that allows you to execute several other run configurations. I wonder if you could use execute some commands (maybe using Bash plugin?) as part of one configuration and then have EnvFile configured on a subsequent run configuration included into your Compound
run configuration.
@Ashald - Thanks for the suggestion, I'll find time to give that a try soon.
I have a similar requirement, but solved it a bit differently
https://github.com/ashald/EnvFile/pull/92