Skip to content

Commit

Permalink
(cake-buildGH-2679) Add GetToolExecutableNames(TSettings settings) to…
Browse files Browse the repository at this point in the history
… Tool

* fixes cake-build#2679
  • Loading branch information
devlead committed Dec 3, 2019
1 parent 090701d commit f110c51
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Cake.Core/Tooling/Tool.cs
Expand Up @@ -228,6 +228,13 @@ protected IProcess RunProcess(TSettings settings, ProcessArgumentBuilder argumen
/// <returns>The name of the tool.</returns>
protected abstract string GetToolName();

/// <summary>
/// Gets the possible names of the tool executable.
/// </summary>
/// <param name="settings">The settings.</param>
/// <returns>The name of the tool.</returns>
protected virtual IEnumerable<string> GetToolExecutableNames(TSettings settings) => GetToolExecutableNames();

/// <summary>
/// Gets the possible names of the tool executable.
/// </summary>
Expand Down Expand Up @@ -294,7 +301,7 @@ private FilePath GetToolPathUsingToolService(TSettings settings)
}

// Look for each possible executable name in various places.
var toolExeNames = GetToolExecutableNames();
var toolExeNames = GetToolExecutableNames(settings);
foreach (var toolExeName in toolExeNames)
{
var result = _tools.Resolve(toolExeName);
Expand Down Expand Up @@ -326,7 +333,7 @@ private FilePath GetToolPathObsolete(TSettings settings)
return toolPath.MakeAbsolute(_environment);
}

var toolExeNames = GetToolExecutableNames();
var toolExeNames = GetToolExecutableNames(settings);
string[] pathDirs = null;

// Look for each possible executable name in various places.
Expand Down

0 comments on commit f110c51

Please sign in to comment.