env icon indicating copy to clipboard operation
env copied to clipboard

Variables not placed into real environment variables

Open mikko-tribo opened this issue 3 years ago • 0 comments

Heya,

thanks for this nifty package, has been pretty helpful so far for easy machine-specific configurations.

One issue I encountered was that this package does not actually place the .env variables into the real environment variable container. This can be problematic in a context where I have some variables I want to set with real env vars on remote machines (through something like docker compose) and locally using .env file, but then I'd have to read the real storage as well as this package's custom storage.

This is the workaround I currently use, but maybe something similar could be in the ParseEnvironmentFile function?

var envDict = env.variables;
foreach (var envVar in envDict)
{
      Environment.SetEnvironmentVariable(envVar.Key, envVar.Value);
}

mikko-tribo avatar Nov 29 '22 08:11 mikko-tribo