-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Meld diff application as a diff program
- Loading branch information
Roman Belonohy
committed
Nov 1, 2022
1 parent
74a83e2
commit 3992e5f
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Assent.Reporters.DiffPrograms; | ||
|
||
public class MeldDiffProgram : DiffProgramBase | ||
{ | ||
static readonly IReadOnlyList<string> DefaultSearchPaths; | ||
|
||
static MeldDiffProgram() | ||
{ | ||
var paths = new List<string>(); | ||
if (DiffReporter.IsWindows) | ||
{ | ||
paths.AddRange(WindowsProgramFilePaths | ||
.Select(p => $@"{p}\Meld\Meld.exe") | ||
.ToArray()); | ||
} | ||
else | ||
{ | ||
paths.Add("/usr/bin/meld"); | ||
paths.Add("/usr/local/bin/meld"); | ||
paths.Add("/snap/bin/meld"); | ||
paths.Add("/opt/homebrew/bin/meld"); | ||
} | ||
DefaultSearchPaths = paths; | ||
} | ||
|
||
public MeldDiffProgram() | ||
: base(DefaultSearchPaths) { } | ||
|
||
protected override string CreateProcessStartArgs(string receivedFile, string approvedFile) => "\"" + receivedFile + "\" \"" + approvedFile + "\""; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters