EnvFile icon indicating copy to clipboard operation
EnvFile copied to clipboard

Run EnvFile after External tool

Open blthayer opened this issue 5 years ago • 3 comments

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.

blthayer avatar Jan 08 '19 20:01 blthayer

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 avatar Jan 14 '19 00:01 ashald

@Ashald - Thanks for the suggestion, I'll find time to give that a try soon.

blthayer avatar Jan 18 '19 17:01 blthayer

I have a similar requirement, but solved it a bit differently

https://github.com/ashald/EnvFile/pull/92

DanielWeigl avatar Aug 30 '19 17:08 DanielWeigl