Skip to content

$ sign in env vars don't get recognized #94

Open
@dormant-user

Description

Problem
When there is a $ in a .env file, the var doesn't get loaded

Minimum reproducible code

echo 'dollar="Dollar$ign"' > .env
use std::fs;

fn main() {
    let _ = dotenv::from_path(".env");
    let dollar = std::env::var("dollar").unwrap_or_default();
    println!("Resolved: {}", dollar);
    let env_content = fs::read_to_string(".env").unwrap_or_default();
    println!("File content: {}", env_content)
}

Expected Output

Resolved: Dollar$ign
File content: dollar="Dollar$ign"

Actual Output

Resolved: 
File content: dollar="Dollar$ign"

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions