Releases: tonerdo/dotnet-env
Releases · tonerdo/dotnet-env
v3.1.1
v3.1.0
v3.0.0
- Parse unquoted values slightly differently to properly parse comments, rejecting quote chars, allow leading and trailing whitespace in interpolated values, do not allow values to start with # anymore, give better errors on invalid quoted values, etc
- Rename ToDictionary to ToDotEnvDictionary for clarity, and add options for behavior
- Get rid of the warnings about vulnerabilities in System.Net.Http 4.3.0 (which was unused)
v2.5.0
v2.4.0
DO NOT USE -- the change in directory did in fact break behavior for at least one existing application. Move to 2.5.0
- Replace the default path from
Directory.GetCurrentDirectory()
with justAppContext.BaseDirectory
-- which should do the same thing, except make things better for some cases, per #69 - Add the newly contributed ConfigurationBuilder integration
v2.3.0
v2.2.0
v2.1.1
v2.1.0
https://www.nuget.org/packages/DotNetEnv/2.1.0
Technically this includes 2 breaking changes, but it is highly unlikely anyone is using them, and the changes are clear improvements.
- Adds Env.LoadMulti for loading multiple .env files on top of each other
- Removes Env.Load for list of lines -- was only used for tests here and highly discouraged for deployed use as it effectively defines hardcoded env vars in code. If you need to reproduce this functionality, use LoadContents with "\n"s between lines in a single string.
- Unquoted values can now include inline whitespace -- but still allow for comments at the end, even while allowing inline hashes in a word (to support k8s configmap from env)
Again, note that this changes the behavior of unquoted values in a noticeable way -- but before this would have been a parse error, so this simply makes it more flexible than it used to be.
v2.0.0
This version has many breaking changes! Most of them will probably not bite you, but you should test.
- Completely replace previous parsing logic with all new using Monadic Parser Combinators via Sprache which enables many of the rest of these changes, and should be much more robust -- and more consistent with other dotenv libraries (i.e. reuse dotenv files, hopefully, or more easily, at least -- there is a widespread lack of consistency here).
- Changes the rules for quoted strings: single and double quotes behave differently from each other and before, notably allowing multiline strings -- but removing interpolation from single quoted strings
- Changes the rules for unquoted strings: trim whitespace is effectively always on and no whitespace is allowed inside such unquoted strings (although you can interpolated variables here, which themselves could have whitespace in their values)
- Allow for hash chars inside quoted values (and unquoted, as it happens)
- Allow for multiline quoted values (e.g. MULTILINE="line1 ... line2 ... line3 ... etc" across multiple lines in a single .env file within a single pair of quotes)
- Parse variables in the
${ENVVAR}
form in addition to$ENVVAR
- Allow for lines to start with
export
(and other such env var setting commands) to allow for .env files to be directly source-d in a terminal - Add a new return value from Load that has all the keys and values set in an IEnumerable<KeyValuePair<string, string>> -- including duplicate keys, so an extension ToDictionary() method is also included to convert that enumerable into a unique key dictionary for configuration loading
- Add fluent methods to turn off options for Load -- and remove all old options related to parsing, leaving only clobberExistingVars, while adding setEnvVars and onlyExactPath for disabling side effects (setting env vars) and traversing up the path to find an .env file, respectively