Skip to content

Commit ca52c38

Browse files
committed
Deleted ProcessHelper
Deleted ProcessHelper and replaced usage with the one from GitTools.Core.
1 parent 5532f9b commit ca52c38

File tree

4 files changed

+20
-163
lines changed

4 files changed

+20
-163
lines changed

src/GitVersionCore/GitVersionCore.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
<Compile Include="GitVersionCache.cs" />
120120
<Compile Include="Helpers\FileSystem.cs" />
121121
<Compile Include="Helpers\IFileSystem.cs" />
122-
<Compile Include="Helpers\ProcessHelper.cs" />
123122
<Compile Include="Helpers\ServiceMessageEscapeHelper.cs" />
124123
<Compile Include="IncrementStrategyFinder.cs" />
125124
<Compile Include="OutputVariables\VersionVariables.cs" />

src/GitVersionCore/Helpers/ProcessHelper.cs

Lines changed: 0 additions & 154 deletions
This file was deleted.

src/GitVersionExe.Tests/GitVersionHelper.cs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Text;
5-
6-
using GitVersion.Helpers;
5+
using GitTools;
76

87
public static class GitVersionHelper
98
{
@@ -41,10 +40,23 @@ static ExecutionResults ExecuteIn(ArgumentBuilder arguments)
4140
new KeyValuePair<string, string>("APPVEYOR", null)
4241
};
4342

44-
var exitCode = ProcessHelper.Run(
45-
s => output.AppendLine(s), s => output.AppendLine(s), null,
46-
gitVersion, arguments.ToString(), arguments.WorkingDirectory,
47-
environmentalVariables);
43+
var exitCode = -1;
44+
45+
try
46+
{
47+
exitCode = ProcessHelper.Run(
48+
s => output.AppendLine(s), s => output.AppendLine(s), null,
49+
gitVersion, arguments.ToString(), arguments.WorkingDirectory,
50+
environmentalVariables);
51+
}
52+
catch (Exception exception)
53+
{
54+
// NOTE: It's the exit code and output from the process we want to test,
55+
// not the internals of the ProcessHelper. That's why we're catching
56+
// any exceptions here, because problems in the process being executed
57+
// should be visible in the output or exit code. @asbjornu
58+
Console.WriteLine(exception);
59+
}
4860

4961
Console.WriteLine("Output from GitVersion.exe");
5062
Console.WriteLine("-------------------------------------------------------");

src/GitVersionExe/SpecifiedArgumentRunner.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ namespace GitVersion
22
{
33
using System;
44
using System.Collections.Generic;
5-
using System.ComponentModel;
65
using System.Linq;
7-
6+
using GitTools;
87
using GitVersion.Helpers;
8+
using WarningException = System.ComponentModel.WarningException;
99

1010
class SpecifiedArgumentRunner
1111
{

0 commit comments

Comments
 (0)