Skip to content

Releases: tonerdo/dotnet-env

v3.1.1

20 Aug 16:06
94e822a
Compare
Choose a tag to compare
  • Use ConcurrentDictionary for FakeEnvVars for thread safety

v3.1.0

30 Jul 18:56
7a37f0d
Compare
Choose a tag to compare
  • Retain interpolation when NoEnvVars() is set (setEnvVars == false)
  • NoClobber works correctly with ConfigurationProvider

v3.0.0

06 Jan 01:27
3c7901d
Compare
Choose a tag to compare
  • 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

03 Feb 01:45
0f89bd4
Compare
Choose a tag to compare

Revert the change from Directory.GetCurrentDirectory() to AppContext,BaseDirectory as it broke existing applications

v2.4.0

30 Jan 07:02
4643f02
Compare
Choose a tag to compare

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 just AppContext.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

15 Jan 16:11
a47e667
Compare
Choose a tag to compare

Adds a new EnvReader helper class #65

v2.2.0

18 Sep 13:36
958f85d
Compare
Choose a tag to compare

Allow dash and period in env var identifiers

v2.1.1

02 Mar 04:32
e4a6a1b
Compare
Choose a tag to compare

Properly handle dollar signs in values

v2.1.0

22 Feb 07:15
6cc4161
Compare
Choose a tag to compare

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

16 Dec 03:16
a336773
Compare
Choose a tag to compare

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