air
air copied to clipboard
Allow specifying list of environment variables.
Thanks for the great project. I've recently come across a case where I have many environment variables I'd like to provide to the binary and listing them all inline with the full_bin
key was becoming a bit unwieldy.
This PR adds a new key, env
, which will accept a table of inputs to prepend to the bin command as environment variables.
For example, this config (truncated):
# air.conf
[build]
bin = "tmp/main"
env.PORT = "3000"
env.ENV = "production"
Will run the following:
PORT=3000 ENV=production tmp/main
Wouldn't it be better to ask the user to have the list of env files as export commands in a separate file called dev.env
and source the file before building, with bash it'd be source dev.env