7

Could anyone say me how to export environment vars before running GoLand Run" with such command:

source .env

.env file:

export MY_VAR="Some value"

Yes I know, that I can define all vars in run config using "Environment variables", but it is too, em... bad solution, as I store all vars in bash file.

yole
  • 92,896
  • 20
  • 260
  • 197
Q-bart
  • 1,503
  • 4
  • 22
  • 41

2 Answers2

8

There is a plugin built for this purpose. It can import.env ,.json and .yaml.

https://plugins.jetbrains.com/plugin/7861-envfile

Crazometer
  • 457
  • 7
  • 12
4

You can go to Tools | Create command line launcher... and then start GoLand from the command line, which will then inherit those environment variables and pass it to your run configurations.

At the moment this feature is not supported, you can request it on the issue tracker.

dlsniper
  • 7,188
  • 1
  • 35
  • 44