Skip to content

Commit 104ce40

Browse files
authored
Merge pull request #341 from sillsdev/bug/wrong-executable-used-on-windows
Use correct hg executable on Windows
2 parents 38ecab3 + c8a5524 commit 104ce40

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/LibChorus/MercurialLocation.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
public class MercurialLocation
1313
{
1414
private static string _pathToMercurialFolder;
15+
private static string _hgExe = Platform.IsWindows ? "hg.exe" : "hg";
1516

1617
/// <summary>
1718
/// Clients can set this if they have their own private copy of Mercurial (recommended)
@@ -31,7 +32,7 @@ public static string PathToMercurialFolder
3132
return;
3233
}
3334
RequireThat.Directory(value).Exists();
34-
string expectedHgLocation=Path.Combine(value, Platform.IsWindows ? "hg.exe" : "hg");
35+
string expectedHgLocation=Path.Combine(value, _hgExe);
3536
if (!File.Exists(expectedHgLocation))
3637
{
3738
throw new FileNotFoundException(expectedHgLocation);
@@ -50,8 +51,8 @@ public static string PathToHgExecutable
5051
GuessAtLocationIfNotSetAlready();
5152

5253
if(string.IsNullOrEmpty(_pathToMercurialFolder))
53-
return "hg"; //rely on the PATH
54-
return Path.Combine(_pathToMercurialFolder, "hg");
54+
return _hgExe; //rely on the PATH
55+
return Path.Combine(_pathToMercurialFolder, _hgExe);
5556
}
5657
}
5758

0 commit comments

Comments
 (0)