Skip to content

Commit

Permalink
Allows overwriting of environment variables (#6)
Browse files Browse the repository at this point in the history
* allows overwriting of environment variables

* fix build
  • Loading branch information
Erwinvandervalk authored Mar 6, 2019
1 parent aa713d7 commit 3bed5d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/LittleForker.Tests/ProcessSupervisorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public async Task Can_restart_a_stopped_short_running_process()
[Fact]
public async Task Can_restart_a_stopped_long_running_process()
{
var supervisor = new ProcessSupervisor(ProcessRunType.NonTerminating, Environment.CurrentDirectory, "dotnet", "./LongRunningProcess/LongRunningProcess.dll");
var supervisor = new ProcessSupervisor(ProcessRunType.NonTerminating, Environment.CurrentDirectory, "dotnet", "./NonTerminatingProcess/NonTerminatingProcess.dll");
supervisor.OutputDataReceived += data => _outputHelper.WriteLine2(data);
var stateIsStopped = supervisor.WhenStateIs(ProcessSupervisor.State.ExitedSuccessfully);
supervisor.Start();
Expand All @@ -129,7 +129,7 @@ public async Task Can_restart_a_stopped_long_running_process()
[Fact]
public async Task When_stop_a_non_terminating_process_then_should_exit_successfully()
{
var supervisor = new ProcessSupervisor(ProcessRunType.NonTerminating, Environment.CurrentDirectory, "dotnet", "./LongRunningProcess/LongRunningProcess.dll");
var supervisor = new ProcessSupervisor(ProcessRunType.NonTerminating, Environment.CurrentDirectory, "dotnet", "./NonTerminatingProcess/NonTerminatingProcess.dll");
supervisor.OutputDataReceived += data => _outputHelper.WriteLine2(data);
var stateIsStopped = supervisor.WhenStateIs(ProcessSupervisor.State.ExitedSuccessfully);
supervisor.Start();
Expand Down
4 changes: 2 additions & 2 deletions src/LittleForker/LittleForker.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand All @@ -16,7 +16,7 @@

<ItemGroup>
<PackageReference Include="LibLog" Version="5.0.3"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All"/>
<!--<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All"/>-->
<PackageReference Include="MinVer" Version="1.0.0-rc.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion src/LittleForker/ProcessSupervisor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private void OnStart()
{
foreach (string key in _environmentVariables.Keys)
{
processStartInfo.EnvironmentVariables.Add(key, _environmentVariables[key]);
processStartInfo.EnvironmentVariables[key] = _environmentVariables[key];
}
}

Expand Down

0 comments on commit 3bed5d1

Please sign in to comment.