use muxer path whenever invoking dotnet

This commit is contained in:
jonsequitur 2017-03-21 14:56:12 -07:00
parent be86933ff8
commit 1b8b1d2b2c

View file

@ -70,15 +70,11 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
ResolveCommand(ref resolvedCommand, ref args);
var commandPath = Env.GetCommandPath(resolvedCommand, ".exe", ".cmd", "") ??
Env.GetCommandPathFromRootPath(_baseDirectory, resolvedCommand, ".exe", ".cmd", "");
Console.WriteLine($"Executing (Captured Output) - {commandPath} {args} - {WorkingDirectoryInfo()}");
Console.WriteLine($"Executing (Captured Output) - {resolvedCommand} {args} - {WorkingDirectoryInfo()}");
return Task.Run(async () => await ExecuteAsyncInternal(resolvedCommand, args)).Result;
}
private async Task<CommandResult> ExecuteAsyncInternal(string executable, string args)
{
var stdOut = new List<String>();
@ -209,8 +205,11 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
executable = new Muxer().MuxerPath;
}
if (!Path.IsPathRooted(executable))
else if ( executable == "dotnet")
{
executable = new Muxer().MuxerPath;
}
else if (!Path.IsPathRooted(executable))
{
executable = Env.GetCommandPath(executable) ??
Env.GetCommandPathFromRootPath(_baseDirectory, executable);