tonerdo / dotnet-env

A .NET library to load environment variables from .env files
MIT License
427 stars 50 forks source link

Update parseVariables to match ${FOO} #43

Closed jongio closed 3 years ago

jongio commented 3 years ago

Right now we only match $FOO

${FOO} format should be supported as well.

We should only need to update this regex here: https://github.com/tonerdo/dotnet-env/blob/43abc48b423b5fc8c1e72f88e8fae9231b3c9486/src/DotNetEnv/Parser.cs#L11

rogusdev commented 3 years ago

So, I am working to wrap up a complete rewrite of the parsing. You're also welcome to put up a PR changing it, including tests! :) But, with luck, I might have this handled in a new way within a week or two at this point.

rogusdev commented 3 years ago

This will be handled by the upcoming dotnet-env 2.0, which you can see a preview of here: https://github.com/rogusdev/dotnet-env/commit/1204d059c8a199cca55ee6eb7b9ee1707946dbba (I just need to fix up all the old tests, which will take a bit)

rogusdev commented 3 years ago

Version 2.0.0 is out with this included! https://www.nuget.org/packages/DotNetEnv/2.0.0/