Skip to content

Commit

Permalink
Merge branch 'pr1120' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Jul 25, 2016
2 parents c29e1d9 + e9ae9e9 commit 318e80e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Cake.Common/Tools/Cake/CakeRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public sealed class CakeRunner : Tool<CakeSettings>
private readonly ICakeEnvironment _environment;
private readonly IFileSystem _fileSystem;
private readonly IGlobber _globber;
private static readonly IEnumerable<FilePath> _executingAssemblyToolPaths = new FilePath[] { System.Reflection.Assembly.GetEntryAssembly().Location };

/// <summary>
/// Initializes a new instance of the <see cref="CakeRunner"/> class.
Expand Down Expand Up @@ -151,18 +152,18 @@ protected override IEnumerable<FilePath> GetAlternativeToolPaths(CakeSettings se

if (!_environment.Platform.IsUnix())
{
return Enumerable.Empty<FilePath>();
return _executingAssemblyToolPaths;
}

if (!_fileSystem.Exist(new DirectoryPath(homebrewCakePath)))
{
return Enumerable.Empty<FilePath>();
return _executingAssemblyToolPaths;
}

var files = _globber.GetFiles(homebrewCakePath + "**/Cake.exe");
var filePaths = files as FilePath[] ?? files.ToArray();
return filePaths.Length == 0
? Enumerable.Empty<FilePath>()
? _executingAssemblyToolPaths
: filePaths.OrderByDescending(f => f.FullPath);
}
}
Expand Down

0 comments on commit 318e80e

Please sign in to comment.