Hacker News new | ask | show | jobs
by steezeburger 783 days ago
You can't source an .env file without some munging. All the keys would need `export` in front of them I believe.
2 comments

That doesn't seem like a huge barrier compared to shipping a dotenv binary compiled specifically to all deployment arch.
It's not a huge barrier, but it's still a barrier. I have lots of infra using Helm/K8s, sometimes Docker. These .env files don't have `export` keywords in them.

So your suggestion is to munge these for local development. And you're okay with that barrier? That's terrible dx, and it adds surface area for bugs.

A sourced .env would have to be correct shell syntax for a sourced environment file, yes.
But a lot of env file doesn't do that iirc. `allexport` solves this though.
You can implement that in a simple shell function anyway.