Skip to content

Multiline is not supported #96

Open

Description

@rsov

According to dotenv README there should be support for multiple lines. However when I try, it only loads the first one.

.env

PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
ASDASDASDASDASD
-----END PRIVATE KEY-----
"

Code:

Future main() async {
  await dotenv.load(fileName: '.env');
  print(dotenv.get("PRIVATE_KEY"));
}

Output:

flutter: "-----BEGIN PRIVATE KEY-----

I believe the bug is coming from this line:

return envString.split('\n');

Activity

  1. java-james commented on Oct 12, 2024

    @java-james
    Owner

    Thanks for raising this issue. I think it would be useful to align with the readme you have linked given it's the original library this was forked from!

    I will try find the time to implement this. Otherwise, feel free to contribute with the PR I will be happy to merge and release this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions