Skip to content

Commit a924722

Browse files
committed
Changed default of ExeSearchPath but only for OSX
1 parent 9a5a048 commit a924722

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Nitrox.Discovery.MSBuild/DiscoverGame.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;
5+
using System.Runtime.InteropServices;
56
using Microsoft.Build.Framework;
67
using Microsoft.Build.Utilities;
78
using Nitrox.Discovery.Extensions;
@@ -26,9 +27,12 @@ public class DiscoverGame : Task
2627
public string ExeName { get; set; } = "";
2728

2829
/// <summary>
29-
/// Relative depth to search within the game root for the game executable.
30+
/// Relative depth to search within the game root for the game executable. Default is 0 unless on OSX, then 1.
3031
/// </summary>
31-
public int ExeSearchDepth { get; set; } = 0;
32+
/// <remarks>
33+
/// As OSX has different file structure (.app/Contents/MacOS or .app/Contents/Resources, the default is 1).
34+
/// </remarks>
35+
public int ExeSearchDepth { get; set; } = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? 1 : 0;
3236

3337
/// <summary>
3438
/// Specifies the libraries to include in the search. The search will start in the same order as given.
@@ -129,8 +133,5 @@ private string ReadGamePath()
129133
}
130134
}
131135

132-
private string GetGameNameCacheFileName()
133-
{
134-
return Path.Combine(IntermediateOutputPath, DiscoverGameCacheFolderName, Path.ChangeExtension(GameName.ReplaceCommonInvalidFileNameChars(), "cache"));
135-
}
136+
private string GetGameNameCacheFileName() => Path.Combine(IntermediateOutputPath, DiscoverGameCacheFolderName, Path.ChangeExtension(GameName.ReplaceCommonInvalidFileNameChars(), "cache"));
136137
}

0 commit comments

Comments
 (0)