Skip to content

Commit 3bed5d1

Browse files
Allows overwriting of environment variables (#6)
* allows overwriting of environment variables * fix build
1 parent aa713d7 commit 3bed5d1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/LittleForker.Tests/ProcessSupervisorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public async Task Can_restart_a_stopped_short_running_process()
112112
[Fact]
113113
public async Task Can_restart_a_stopped_long_running_process()
114114
{
115-
var supervisor = new ProcessSupervisor(ProcessRunType.NonTerminating, Environment.CurrentDirectory, "dotnet", "./LongRunningProcess/LongRunningProcess.dll");
115+
var supervisor = new ProcessSupervisor(ProcessRunType.NonTerminating, Environment.CurrentDirectory, "dotnet", "./NonTerminatingProcess/NonTerminatingProcess.dll");
116116
supervisor.OutputDataReceived += data => _outputHelper.WriteLine2(data);
117117
var stateIsStopped = supervisor.WhenStateIs(ProcessSupervisor.State.ExitedSuccessfully);
118118
supervisor.Start();
@@ -129,7 +129,7 @@ public async Task Can_restart_a_stopped_long_running_process()
129129
[Fact]
130130
public async Task When_stop_a_non_terminating_process_then_should_exit_successfully()
131131
{
132-
var supervisor = new ProcessSupervisor(ProcessRunType.NonTerminating, Environment.CurrentDirectory, "dotnet", "./LongRunningProcess/LongRunningProcess.dll");
132+
var supervisor = new ProcessSupervisor(ProcessRunType.NonTerminating, Environment.CurrentDirectory, "dotnet", "./NonTerminatingProcess/NonTerminatingProcess.dll");
133133
supervisor.OutputDataReceived += data => _outputHelper.WriteLine2(data);
134134
var stateIsStopped = supervisor.WhenStateIs(ProcessSupervisor.State.ExitedSuccessfully);
135135
supervisor.Start();

src/LittleForker/LittleForker.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
@@ -16,7 +16,7 @@
1616

1717
<ItemGroup>
1818
<PackageReference Include="LibLog" Version="5.0.3"/>
19-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All"/>
19+
<!--<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All"/>-->
2020
<PackageReference Include="MinVer" Version="1.0.0-rc.1">
2121
<PrivateAssets>all</PrivateAssets>
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>

src/LittleForker/ProcessSupervisor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private void OnStart()
229229
{
230230
foreach (string key in _environmentVariables.Keys)
231231
{
232-
processStartInfo.EnvironmentVariables.Add(key, _environmentVariables[key]);
232+
processStartInfo.EnvironmentVariables[key] = _environmentVariables[key];
233233
}
234234
}
235235

0 commit comments

Comments
 (0)