Fix .env file example in docs (#9064)

## Summary

The current example is broken since `$MY_ENV_VAR` gets evaluated by the
shell.
This commit is contained in:
Charlie Marsh 2024-11-12 12:54:58 -05:00 committed by GitHub
parent 720a47755b
commit 8ed37eeab8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,7 +83,9 @@ the `--env-file` flag to `uv run`.
For example, to load environment variables from a `.env` file in the current working directory:
```console
$ uv run --env-file .env -- echo $MY_ENV_VAR
$ echo "MY_VAR='Hello, world!'" > .env
$ uv run --env-file .env -- python -c 'import os; print(os.getenv("MY_VAR"))'
Hello, world!
```
The `--env-file` flag can be provided multiple times, with subsequent files overriding values