Execute a command using an environment from .env file. exec-env
also proxies all os signals to child process.
Visit the releases page to download one of the pre-built binaries.
As secondary option you can use go install
:
go install github.com/valenok-husky/exec-env
exec-env -f <path to your env file> <your command with possible launch flags>
PORT=8080
LOG_LVL=debug
PREFIX="app prefix"
exec-env -f dev.env printenv
Printenv is not a part of exec-env
. Printenv is a unix command. Check the man page.
The output is
<your own environment variables>
...
PORT=8080
LOG_LVL=debug
PREFIX=app prefix
It's working 🎉