Make env accept a string of comma separeted key value pairs

I was having problems using ENV with variables so i modified it to accept a string of comma separated key value pairs similar to ports e.g.

"KEY=value,OTHER_KEY=value" 

I'm not 100% sure this is needed, perhaps there is a way to use the current argument with variables?