mirror of
https://github.com/astral-sh/uv.git
synced 2025-12-09 19:29:29 +00:00
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:
parent
720a47755b
commit
8ed37eeab8
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue