Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2.0
version: 2.1
jobs:
build:
docker:
- image: mcr.microsoft.com/dotnet/sdk:3.1
- image: mcr.microsoft.com/dotnet/sdk:5.0
steps:
- checkout
- run:
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<PackageVersion>2.1.3</PackageVersion>
<PackageVersion>3.0.0</PackageVersion>
<Title>dotenv.net.DependencyInjection.Autofac</Title>
<Authors>Winner-Timothy Bolorunduro</Authors>
<Description>Adds DI support for values read from the environment for Autofac</Description>
Expand All @@ -12,11 +12,11 @@
<RepositoryType>git</RepositoryType>
<PackageTags>autofac, dotenv, net core</PackageTags>
<PackageReleaseNotes>- initial release</PackageReleaseNotes>
<AssemblyVersion>2.1.3</AssemblyVersion>
<AssemblyVersion>3.0.0</AssemblyVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Copyright>Copyright 2021</Copyright>
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>
<FileVersion>2.1.3</FileVersion>
<TargetFrameworks>net5.0;net5.0-windows;netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>
<FileVersion>3.0.0</FileVersion>
<NeutralLanguage>en-NG</NeutralLanguage>
</PropertyGroup>

Expand All @@ -35,4 +35,12 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="Autofac" Version="6.1.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Autofac" Version="6.1.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0-windows' ">
<PackageReference Include="Autofac" Version="6.1.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>2.1.3</PackageVersion>
<PackageVersion>3.0.0</PackageVersion>
<Title>dotenv.net.DependencyInjection.Microsoft</Title>
<Authors>Winner-Timothy Bolorunduro</Authors>
<Description>Adds DI support for values read from the environment for Microsoft Service Collection</Description>
Expand All @@ -14,9 +14,9 @@
<RepositoryType>git</RepositoryType>
<PackageTags>service collection, dotenv</PackageTags>
<PackageReleaseNotes>- bump support</PackageReleaseNotes>
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>
<AssemblyVersion>2.1.3</AssemblyVersion>
<FileVersion>2.1.3</FileVersion>
<TargetFrameworks>net5.0;net5.0-windows;netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>
<AssemblyVersion>3.0.0</AssemblyVersion>
<FileVersion>3.0.0</FileVersion>
<NeutralLanguage>en-NG</NeutralLanguage>
</PropertyGroup>

Expand All @@ -35,4 +35,12 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0-windows' ">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
</ItemGroup>
</Project>
31 changes: 31 additions & 0 deletions src/dotenv.net/DotEnv.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using dotenv.net.DependencyInjection.Infrastructure;

Expand Down Expand Up @@ -70,5 +72,34 @@ public static bool AutoConfig(int levelsToSearch = 4)

return false;
}

/// <summary>
/// Load the values in the provided env file into the environment variables
/// </summary>
/// <param name="envFilePath">The path to the .env file to be read</param>
/// <param name="encoding">The encoding that the env file was saved in</param>
/// <param name="ignoreExceptions">Determines if an exception should be thrown or swallowed</param>
public static void Load(string envFilePath = DefaultEnvFileName, Encoding encoding = null,
bool ignoreExceptions = true)
{
ConfigRunner(ignoreExceptions, envFilePath, encoding, true);
}

/// <summary>
/// Load the values in the provided env files into the environment variables
/// </summary>
/// <param name="envFilePaths">The paths to the .env files to be read</param>
/// <param name="encoding">The encoding that the env file was saved in</param>
/// <param name="ignoreExceptions">Determines if an exception should be thrown or swallowed</param>
public static void Load(IEnumerable<string> envFilePaths = null, Encoding encoding = null,
bool ignoreExceptions = true)
{
envFilePaths ??= Enumerable.Empty<string>();

foreach (var envFilePath in envFilePaths)
{
ConfigRunner(ignoreExceptions, envFilePath, encoding, true);
}
}
}
}
8 changes: 4 additions & 4 deletions src/dotenv.net/dotenv.net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<PackageLicenseUrl>https://github.com/bolorundurowb/dotenv.net/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/bolorundurowb/dotenv.net</RepositoryUrl>
<LangVersion>default</LangVersion>
<PackageVersion>2.1.3</PackageVersion>
<PackageVersion>3.0.0</PackageVersion>
<RepositoryType>git</RepositoryType>
<PackageTags>dotnet, environment, variables, env, dotenv, net core, autofac</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyVersion>2.1.3</AssemblyVersion>
<FileVersion>2.1.3</FileVersion>
<AssemblyVersion>3.0.0</AssemblyVersion>
<FileVersion>3.0.0</FileVersion>
<NeutralLanguage>en-NG</NeutralLanguage>
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net5.0;net5.0-windows;netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>
<Title>dotenv.net</Title>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.0.1">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.0.1">
Expand Down
2 changes: 1 addition & 1 deletion tests/dotenv.net.Tests/dotenv.net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
<PackageVersion>1.0.6</PackageVersion>
</PropertyGroup>
Expand Down