Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows back slash doesnt work #82

Open
JumpyLionnn opened this issue Aug 10, 2023 · 2 comments
Open

windows back slash doesnt work #82

JumpyLionnn opened this issue Aug 10, 2023 · 2 comments

Comments

@JumpyLionnn
Copy link

JumpyLionnn commented Aug 10, 2023

i use windows and when i use back slashes in my env the crate returns an error while trying to parse it.

SOME_VAR=some\path\to\a\file

dotenvy = "0.15.7"
rustc 1.70.0
error: LineParse("\"some\\path\\to\\a\\file\"", 4)
changing it to forward slashes seems to work

@allan2
Copy link
Owner

allan2 commented Aug 10, 2023

Could you provide a minimal example with your code and your .env file?

@JumpyLionnn
Copy link
Author

sure, here it is
.env

PATH=some\path\to\file.txt

src/main.rs

use dotenvy::dotenv;

fn main() {
    dotenv().unwrap();
    println!("var {:?}", std::env::var("PATH"));
}

the error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: LineParse("some\\path\\to\\file.txt", 5)', src\main.rs:4:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants