From 2d9ad196b5d0ca6c419632da43bc63de23343c9f Mon Sep 17 00:00:00 2001 From: Winner-Timothy Bolorunduro Date: Fri, 5 Mar 2021 14:21:11 +0100 Subject: [PATCH 1/7] ft: update the versions --- .../dotenv.net.DependencyInjection.Autofac.csproj | 6 +++--- .../dotenv.net.DependencyInjection.Microsoft.csproj | 6 +++--- src/dotenv.net/dotenv.net.csproj | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dotenv.net.DependencyInjection.Autofac/dotenv.net.DependencyInjection.Autofac.csproj b/src/dotenv.net.DependencyInjection.Autofac/dotenv.net.DependencyInjection.Autofac.csproj index 1d3c387..ca7259f 100644 --- a/src/dotenv.net.DependencyInjection.Autofac/dotenv.net.DependencyInjection.Autofac.csproj +++ b/src/dotenv.net.DependencyInjection.Autofac/dotenv.net.DependencyInjection.Autofac.csproj @@ -1,7 +1,7 @@ - 2.1.3 + 3.0.0 dotenv.net.DependencyInjection.Autofac Winner-Timothy Bolorunduro Adds DI support for values read from the environment for Autofac @@ -12,11 +12,11 @@ git autofac, dotenv, net core - initial release - 2.1.3 + 3.0.0 true Copyright 2021 netstandard1.6;netstandard2.0;netstandard2.1 - 2.1.3 + 3.0.0 en-NG diff --git a/src/dotenv.net.DependencyInjection.Microsoft/dotenv.net.DependencyInjection.Microsoft.csproj b/src/dotenv.net.DependencyInjection.Microsoft/dotenv.net.DependencyInjection.Microsoft.csproj index f6d3f2c..f6f9d01 100644 --- a/src/dotenv.net.DependencyInjection.Microsoft/dotenv.net.DependencyInjection.Microsoft.csproj +++ b/src/dotenv.net.DependencyInjection.Microsoft/dotenv.net.DependencyInjection.Microsoft.csproj @@ -2,7 +2,7 @@ true - 2.1.3 + 3.0.0 dotenv.net.DependencyInjection.Microsoft Winner-Timothy Bolorunduro Adds DI support for values read from the environment for Microsoft Service Collection @@ -15,8 +15,8 @@ service collection, dotenv - bump support netstandard1.6;netstandard2.0;netstandard2.1 - 2.1.3 - 2.1.3 + 3.0.0 + 3.0.0 en-NG diff --git a/src/dotenv.net/dotenv.net.csproj b/src/dotenv.net/dotenv.net.csproj index ab499fa..6b6abec 100644 --- a/src/dotenv.net/dotenv.net.csproj +++ b/src/dotenv.net/dotenv.net.csproj @@ -11,12 +11,12 @@ https://github.com/bolorundurowb/dotenv.net/blob/master/LICENSE https://github.com/bolorundurowb/dotenv.net default - 2.1.3 + 3.0.0 git dotnet, environment, variables, env, dotenv, net core, autofac true - 2.1.3 - 2.1.3 + 3.0.0 + 3.0.0 en-NG netstandard1.6;netstandard2.0;netstandard2.1 dotenv.net From 5ed7f78aeb1850c4056a63354a694f606926664f Mon Sep 17 00:00:00 2001 From: Winner-Timothy Bolorunduro Date: Fri, 5 Mar 2021 14:38:09 +0100 Subject: [PATCH 2/7] ft: update targets --- .../dotenv.net.DependencyInjection.Autofac.csproj | 10 +++++++++- .../dotenv.net.DependencyInjection.Microsoft.csproj | 10 +++++++++- src/dotenv.net/dotenv.net.csproj | 2 +- ...dotenv.net.DependencyInjection.Autofac.Tests.csproj | 2 +- ...tenv.net.DependencyInjection.Microsoft.Tests.csproj | 2 +- tests/dotenv.net.Tests/dotenv.net.Tests.csproj | 2 +- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/dotenv.net.DependencyInjection.Autofac/dotenv.net.DependencyInjection.Autofac.csproj b/src/dotenv.net.DependencyInjection.Autofac/dotenv.net.DependencyInjection.Autofac.csproj index ca7259f..dd7f3c6 100644 --- a/src/dotenv.net.DependencyInjection.Autofac/dotenv.net.DependencyInjection.Autofac.csproj +++ b/src/dotenv.net.DependencyInjection.Autofac/dotenv.net.DependencyInjection.Autofac.csproj @@ -15,7 +15,7 @@ 3.0.0 true Copyright 2021 - netstandard1.6;netstandard2.0;netstandard2.1 + net5.0;net5.0-windows;netstandard1.6;netstandard2.0;netstandard2.1 3.0.0 en-NG @@ -35,4 +35,12 @@ + + + + + + + + diff --git a/src/dotenv.net.DependencyInjection.Microsoft/dotenv.net.DependencyInjection.Microsoft.csproj b/src/dotenv.net.DependencyInjection.Microsoft/dotenv.net.DependencyInjection.Microsoft.csproj index f6f9d01..30d70bc 100644 --- a/src/dotenv.net.DependencyInjection.Microsoft/dotenv.net.DependencyInjection.Microsoft.csproj +++ b/src/dotenv.net.DependencyInjection.Microsoft/dotenv.net.DependencyInjection.Microsoft.csproj @@ -14,7 +14,7 @@ git service collection, dotenv - bump support - netstandard1.6;netstandard2.0;netstandard2.1 + net5.0;net5.0-windows;netstandard1.6;netstandard2.0;netstandard2.1 3.0.0 3.0.0 en-NG @@ -35,4 +35,12 @@ + + + + + + + + diff --git a/src/dotenv.net/dotenv.net.csproj b/src/dotenv.net/dotenv.net.csproj index 6b6abec..b92fc6c 100644 --- a/src/dotenv.net/dotenv.net.csproj +++ b/src/dotenv.net/dotenv.net.csproj @@ -18,7 +18,7 @@ 3.0.0 3.0.0 en-NG - netstandard1.6;netstandard2.0;netstandard2.1 + net5.0;net5.0-windows;netstandard1.6;netstandard2.0;netstandard2.1 dotenv.net diff --git a/tests/dotenv.net.DependencyInjection.Autofac.Tests/dotenv.net.DependencyInjection.Autofac.Tests.csproj b/tests/dotenv.net.DependencyInjection.Autofac.Tests/dotenv.net.DependencyInjection.Autofac.Tests.csproj index 77e2620..eff3e32 100644 --- a/tests/dotenv.net.DependencyInjection.Autofac.Tests/dotenv.net.DependencyInjection.Autofac.Tests.csproj +++ b/tests/dotenv.net.DependencyInjection.Autofac.Tests/dotenv.net.DependencyInjection.Autofac.Tests.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp3.1 + net5.0 diff --git a/tests/dotenv.net.DependencyInjection.Microsoft.Tests/dotenv.net.DependencyInjection.Microsoft.Tests.csproj b/tests/dotenv.net.DependencyInjection.Microsoft.Tests/dotenv.net.DependencyInjection.Microsoft.Tests.csproj index bbe8340..4c4b386 100644 --- a/tests/dotenv.net.DependencyInjection.Microsoft.Tests/dotenv.net.DependencyInjection.Microsoft.Tests.csproj +++ b/tests/dotenv.net.DependencyInjection.Microsoft.Tests/dotenv.net.DependencyInjection.Microsoft.Tests.csproj @@ -1,7 +1,7 @@ Exe - netcoreapp3.1 + net5.0 diff --git a/tests/dotenv.net.Tests/dotenv.net.Tests.csproj b/tests/dotenv.net.Tests/dotenv.net.Tests.csproj index 6a43b73..c28598e 100644 --- a/tests/dotenv.net.Tests/dotenv.net.Tests.csproj +++ b/tests/dotenv.net.Tests/dotenv.net.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp3.1 + net5.0 false 1.0.6 From 341773588aa6d9fa847064bb9425c9f58969e6ca Mon Sep 17 00:00:00 2001 From: Winner-Timothy Bolorunduro Date: Fri, 5 Mar 2021 14:40:05 +0100 Subject: [PATCH 3/7] ft: update build config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b95db9..d525954 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2.0 jobs: build: docker: - - image: mcr.microsoft.com/dotnet/sdk:3.1 + - image: mcr.microsoft.com/dotnet/sdk:5.0 steps: - checkout - run: @@ -28,7 +28,7 @@ jobs: - run: name: Install Coveralls command: - dotnet tool install coveralls.net --version 2.0.0 --tool-path tools + dotnet tool install coveralls.net --version 3.0.0 --tool-path tools - run: name: Report Coverage command: From 8e291732e2134731299e2f15435d3c5b3540d71e Mon Sep 17 00:00:00 2001 From: Winner-Timothy Bolorunduro Date: Fri, 5 Mar 2021 14:47:06 +0100 Subject: [PATCH 4/7] ft: change circle versions --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d525954..d191187 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,4 @@ -version: 2.0 +version: 2.1 jobs: build: docker: From e86c3d3c6135eace079d5fe04725e766472682bf Mon Sep 17 00:00:00 2001 From: Winner-Timothy Bolorunduro Date: Fri, 5 Mar 2021 15:42:55 +0100 Subject: [PATCH 5/7] ft: add in new load method --- src/dotenv.net/DotEnv.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dotenv.net/DotEnv.cs b/src/dotenv.net/DotEnv.cs index 446424a..b9ac669 100644 --- a/src/dotenv.net/DotEnv.cs +++ b/src/dotenv.net/DotEnv.cs @@ -70,5 +70,11 @@ public static bool AutoConfig(int levelsToSearch = 4) return false; } + + public static void Load(string envFilePath = DefaultEnvFileName, Encoding encoding = null, + bool ignoreExceptions = true) + { + ConfigRunner(ignoreExceptions, envFilePath, encoding, true); + } } } \ No newline at end of file From 6e3dce3bcce4b9d46373c2e01d87ed0a637ae3ad Mon Sep 17 00:00:00 2001 From: Winner-Timothy Bolorunduro Date: Fri, 5 Mar 2021 15:47:49 +0100 Subject: [PATCH 6/7] ft: add load method for the number of env paths --- src/dotenv.net/DotEnv.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/dotenv.net/DotEnv.cs b/src/dotenv.net/DotEnv.cs index b9ac669..69e9a28 100644 --- a/src/dotenv.net/DotEnv.cs +++ b/src/dotenv.net/DotEnv.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; using dotenv.net.DependencyInjection.Infrastructure; @@ -76,5 +78,16 @@ public static void Load(string envFilePath = DefaultEnvFileName, Encoding encodi { ConfigRunner(ignoreExceptions, envFilePath, encoding, true); } + + public static void Load(IEnumerable envFilePaths = null, Encoding encoding = null, + bool ignoreExceptions = true) + { + envFilePaths ??= Enumerable.Empty(); + + foreach (var envFilePath in envFilePaths) + { + ConfigRunner(ignoreExceptions, envFilePath, encoding, true); + } + } } } \ No newline at end of file From 887d25b881b14d4471af559efc94fcaab20b877e Mon Sep 17 00:00:00 2001 From: Winner-Timothy Bolorunduro Date: Fri, 5 Mar 2021 15:59:28 +0100 Subject: [PATCH 7/7] ft: add in load method docs --- src/dotenv.net/DotEnv.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/dotenv.net/DotEnv.cs b/src/dotenv.net/DotEnv.cs index 69e9a28..e48a375 100644 --- a/src/dotenv.net/DotEnv.cs +++ b/src/dotenv.net/DotEnv.cs @@ -73,12 +73,24 @@ public static bool AutoConfig(int levelsToSearch = 4) return false; } + /// + /// Load the values in the provided env file into the environment variables + /// + /// The path to the .env file to be read + /// The encoding that the env file was saved in + /// Determines if an exception should be thrown or swallowed public static void Load(string envFilePath = DefaultEnvFileName, Encoding encoding = null, bool ignoreExceptions = true) { ConfigRunner(ignoreExceptions, envFilePath, encoding, true); } + /// + /// Load the values in the provided env files into the environment variables + /// + /// The paths to the .env files to be read + /// The encoding that the env file was saved in + /// Determines if an exception should be thrown or swallowed public static void Load(IEnumerable envFilePaths = null, Encoding encoding = null, bool ignoreExceptions = true) {