Load variables from the .env file.
Script to load variables described in a .env
file before executing given command.
Create a .env
file.
PORT=3000
Then run your command prefixing it with ./dotenv
. e.g.
$ ./dotenv rails server
You also can source the script to load the variables into a bash script.
source ./dotenv
echo $PORT
The MIT License © 2017 Arthur Corenzan