dotenv-rs / dotenv

Library to help supply environment variables in testing and development
MIT License
566 stars 45 forks source link

Binary releases? #64

Open coolaj86 opened 4 years ago

coolaj86 commented 4 years ago

It would be really awesome to have this as a binary that could run like this:

dotenv .env -- someprogram --foo bar

Do you have any interest in supporting that? I'd be willing to help.

shesek commented 3 years ago

Why not (source .env && someprogram --foo bar)? (requires using export in your .env files to make them shell-compatible, which dotenv accepts too. use . instead of source if you're using sh.)

coolaj86 commented 3 years ago
  1. It's not a cross-platform approach.
  2. It requires a shell, which you don't always have with service managers like systemd.
mhutter commented 2 years ago

It's not a cross-platform approach.

That's true but every platform offers built-in tools to read ENV vars from a file

It requires a shell, which you don't always have with service managers like systemd.

Most service manager already support reading env vars from a file. For systemd, there is EnvironmentFile