Skip to content

Commit 072ead0

Browse files
committed
remove targetExists
1 parent 62896e0 commit 072ead0

24 files changed

Lines changed: 32 additions & 43 deletions

docs/diff-tool.custom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DiffTools.AddCustomTool(
1717
isMdi: false,
1818
supportsText: true,
1919
requiresTarget: true,
20-
buildArguments: (tempFile, targetFile, targetExists) =>
20+
buildArguments: (tempFile, targetFile) =>
2121
{
2222
return $"\"{tempFile}\" \"{targetFile}\"";
2323
},

docs/diff-tool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ This behavior is currently supported on Windows. On Linux and OSX, tool instance
201201
### Windows settings:
202202

203203

204-
* Example arguments: `"tempFile" "targetFile" --cs CreateBakFiles=0`
204+
* Example arguments: `"tempFile" "targetFile" --cs CreateBakFiles=0`
205205
* Scanned path: `%ProgramFiles%\KDiff3\kdiff3.exe`
206206

207207
### OSX settings:
208208

209209

210-
* Example arguments: `"tempFile" "targetFile" --cs CreateBakFiles=0`
210+
* Example arguments: `"tempFile" "targetFile" --cs CreateBakFiles=0`
211211
* Scanned path: `/Applications/kdiff3.app/Contents/MacOS/kdiff3`
212212

213213
## [Meld](https://meldmerge.org/)

src/DiffEngine.Tests/DiffToolsTest.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void AddCustomTool(string diffToolPath)
3232
isMdi: false,
3333
supportsText: true,
3434
requiresTarget: true,
35-
buildArguments: (tempFile, targetFile, targetExists) =>
35+
buildArguments: (tempFile, targetFile) =>
3636
{
3737
return $"\"{tempFile}\" \"{targetFile}\"";
3838
},
@@ -136,20 +136,9 @@ public void WriteFoundTools()
136136

137137
static void WriteArguments(StreamWriter writer, BuildArguments buildArguments)
138138
{
139-
var argumentsWithTarget = buildArguments("tempFile", "targetFile", true);
140-
var argumentsWithNoTarget = buildArguments("tempFile", "targetFile", false);
141-
if (argumentsWithNoTarget == argumentsWithTarget)
142-
{
143-
writer.WriteLine($@"
139+
var argumentsWithTarget = buildArguments("tempFile", "targetFile");
140+
writer.WriteLine($@"
144141
* Example arguments: `{argumentsWithTarget}`");
145-
}
146-
else
147-
{
148-
writer.WriteLine($@"
149-
* Example arguments:
150-
* When target exists: `{argumentsWithTarget}`
151-
* When no target exists: `{argumentsWithNoTarget}`");
152-
}
153142
}
154143

155144
static void WritePaths(TextWriter writer, string[] paths)

src/DiffEngine.Tests/diffTools.include.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@
124124
### Windows settings:
125125

126126

127-
* Example arguments: `"tempFile" "targetFile" --cs CreateBakFiles=0`
127+
* Example arguments: `"tempFile" "targetFile" --cs CreateBakFiles=0`
128128
* Scanned path: `%ProgramFiles%\KDiff3\kdiff3.exe`
129129

130130
### OSX settings:
131131

132132

133-
* Example arguments: `"tempFile" "targetFile" --cs CreateBakFiles=0`
133+
* Example arguments: `"tempFile" "targetFile" --cs CreateBakFiles=0`
134134
* Scanned path: `/Applications/kdiff3.app/Contents/MacOS/kdiff3`
135135

136136
## [Meld](https://meldmerge.org/)

src/DiffEngine/BuildArguments.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
namespace DiffEngine
22
{
3-
public delegate string BuildArguments(string tempFile, string targetFile, bool targetExists);
3+
public delegate string BuildArguments(string tempFile, string targetFile);
44
}

src/DiffEngine/DiffRunner.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void Kill(string tempFile, string targetFile)
3030
return;
3131
}
3232

33-
var command = diffTool.BuildCommand(tempFile, targetFile, File.Exists(targetFile));
33+
var command = diffTool.BuildCommand(tempFile, targetFile);
3434

3535
if (diffTool.IsMdi)
3636
{
@@ -88,7 +88,7 @@ static LaunchResult Launch(ResolvedDiffTool diffTool, string tempFile, string ta
8888

8989
launchedInstances++;
9090

91-
var command = diffTool.BuildCommand(tempFile, targetFile, targetExists);
91+
var command = diffTool.BuildCommand(tempFile, targetFile);
9292
var isDiffToolRunning = ProcessCleanup.IsRunning(command);
9393
if (isDiffToolRunning)
9494
{
@@ -103,7 +103,7 @@ static LaunchResult Launch(ResolvedDiffTool diffTool, string tempFile, string ta
103103
}
104104
}
105105

106-
var arguments = diffTool.BuildArguments(tempFile, targetFile, targetExists);
106+
var arguments = diffTool.BuildArguments(tempFile, targetFile);
107107
try
108108
{
109109
Process.Start(diffTool.ExePath, arguments);

src/DiffEngine/Implementation/AraxisMerge.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ public static ToolDefinition AraxisMerge() =>
1111
isMdi: true,
1212
supportsText: true,
1313
requiresTarget: true,
14-
buildWindowsArguments: (tempFile, targetFile, targetExists) => $"/nowait \"{tempFile}\" \"{targetFile}\"",
14+
buildWindowsArguments: (tempFile, targetFile) => $"/nowait \"{tempFile}\" \"{targetFile}\"",
1515
buildLinuxArguments: null,
16-
buildOsxArguments: (tempFile, targetFile, targetExists) => $"-nowait \"{tempFile}\" \"{targetFile}\"",
16+
buildOsxArguments: (tempFile, targetFile) => $"-nowait \"{tempFile}\" \"{targetFile}\"",
1717
windowsExePaths: new[]
1818
{
1919
@"%ProgramFiles%\Araxis\Araxis Merge\Compare.exe"

src/DiffEngine/Implementation/BeyondCompare.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static ToolDefinition BeyondCompare() =>
1010
isMdi: false,
1111
supportsText: true,
1212
requiresTarget: false,
13-
buildArguments: (tempFile, targetFile, targetExists) => $"/solo \"{tempFile}\" \"{targetFile}\"",
13+
buildArguments: (tempFile, targetFile) => $"/solo \"{tempFile}\" \"{targetFile}\"",
1414
windowsExePaths: new[]
1515
{
1616
@"%ProgramFiles%\Beyond Compare *\BCompare.exe"

src/DiffEngine/Implementation/CodeCompare.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static ToolDefinition CodeCompare() =>
1111
isMdi: true,
1212
supportsText: true,
1313
requiresTarget: true,
14-
buildArguments: (tempFile, targetFile, targetExists) => $"\"{tempFile}\" \"{targetFile}\"",
14+
buildArguments: (tempFile, targetFile) => $"\"{tempFile}\" \"{targetFile}\"",
1515
windowsExePaths: new[]
1616
{
1717
@"%ProgramFiles%\Devart\Code Compare\CodeCompare.exe"

src/DiffEngine/Implementation/DiffMerge.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static ToolDefinition DiffMerge() =>
1111
isMdi: false,
1212
supportsText: true,
1313
requiresTarget: true,
14-
buildArguments: (tempFile, targetFile, targetExists) => $"--nosplash \"{tempFile}\" \"{targetFile}\"",
14+
buildArguments: (tempFile, targetFile) => $"--nosplash \"{tempFile}\" \"{targetFile}\"",
1515
windowsExePaths: new[]
1616
{
1717
@"%ProgramFiles%\SourceGear\Common\DiffMerge\sgdm.exe"

0 commit comments

Comments
 (0)