Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,15 @@ Verifying a download, and the full comparison, is in the

## Running

- `envrun foo`: run `foo` with the environment defaults loaded from `.env` if it exists,
or fail if it cannot be read.
- `envrun foo`: run `foo` with the environment defaults loaded from `.env`,
or fail if it is missing or cannot be read.
- `envrun -f other.env env`: run the `env` command with the defaults loaded from `other.env`.

The file is required either way.
A run with no defaults to add is a run that does not need `envrun`,
so a missing file is a failure rather than a silent pass-through:
configuration that was meant to be there is worth stopping for.

`envrun` reads the file, it never sources it — no expansion, no execution,
so `DSN=postgres://${INSTANCE}/db` reaches the command exactly as written.
A shell sourcing the same file would substitute instead,
Expand Down
2 changes: 2 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// -f file
// Read the environment from file
// instead of .env in the working directory.
// The file must exist, named or defaulted:
// a run with no defaults to add does not need envrun.
//
// The file is read, never sourced — no expansion and no execution — so a value
// reaches the command exactly as written. Its variables are merged under the
Expand Down