Skip to content

Commit

Permalink
Make root README.md a symlink
Browse files Browse the repository at this point in the history
- upadate *dotenv/README.md* with the latest changest from *README.md*
- make *README.md* a symbolic link pointing to *dotenv/README.md*

This change mirrors the README setup in axum.
  • Loading branch information
allan2 committed Mar 18, 2024
1 parent 7644579 commit 1c84e80
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 94 deletions.
82 changes: 0 additions & 82 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
26 changes: 14 additions & 12 deletions dotenv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,24 @@ This library loads environment variables from a _.env_ file. This is convenient

### Loading at runtime

```rust
```rs
use dotenvy::dotenv;
use std::env;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
// Load environment variables from .env file.
// Fails if .env file not found, not readable or invalid.
dotenvy::dotenv()?;
fn main() {
// load environment variables from .env file
dotenv().expect(".env file not found");

for (key, value) in env::vars() {
println!("{key}: {value}");
}

Ok(())
}
```

### Loading at compile time

The `dotenv!` macro provided by `dotenvy_macro` crate can be used.

Warning: there is an outstanding issue with rust-analyzer ([rust-analyzer #9606](https://github.com/rust-analyzer/rust-analyzer/issues/9606)) related to the `dotenv!` macro

## Minimum supported Rust version

Currently: **1.68.0**
Expand All @@ -62,19 +57,26 @@ This fork intends to serve as the development home for the dotenv implementation

This repo fixes:

- home directory works correctly (no longer using the deprecated `std::env::home_dir`)
- more helpful errors for `dotenv!` ([dotenv-rs/dotenv #57](https://github.com/dotenv-rs/dotenv/pull/57))

It also adds:

- multiline support for environment variable values
- `io::Read` support via [`from_read`](https://docs.rs/dotenvy/latest/dotenvy/fn.from_read.html) and [`from_read_iter`](https://docs.rs/dotenvy/latest/dotenvy/fn.from_read_iter.html)
- override support via [`dotenv_override`], [`from_filename_override`], [`from_path_override`] and [`from_read_override`]
- improved docs

For a full list of changes, refer to the [changelog](./CHANGELOG.md).

## Contributing

Thank you very much for considering to contribute to this project! See
[CONTRIBUTING.md](./CONTRIBUTING.md) for details.

**Note**: Before you take the time to open a pull request, please open an issue first.

## The legend

Legend has it that the Lost Maintainer will return, merging changes from `dotenvy` into `dotenv` with such thrust that all `Cargo.toml`s will lose one keystroke. Only then shall the Rust dotenv crateverse be united in true harmony.

Until then, this repo dutifully carries on the dotenv torch. It is actively maintained. Contributions and PRs are very welcome!
Until then, this repo dutifully carries on the dotenv torch. It is actively maintained.

0 comments on commit 1c84e80

Please sign in to comment.