Merge pull request #5016 from nguerrera/workaround-msbuild-path-issue

Work around msbuild bug that blocks git tool tasks in VS2017 prompt
This commit is contained in:
Livar 2016-12-14 09:12:23 -08:00 committed by GitHub
commit 88ac88802b
2 changed files with 8 additions and 2 deletions

View file

@ -3,6 +3,7 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.Runtime.InteropServices;
namespace Microsoft.DotNet.Cli.Build
{
@ -92,7 +93,9 @@ namespace Microsoft.DotNet.Cli.Build
protected override string GenerateFullPathToTool()
{
return "git";
// Workaround: https://github.com/Microsoft/msbuild/issues/1215
// There's a "git" folder on the PATH in VS 2017 Developer command prompt and it causes msbuild to fail to execute git.
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "git.exe" : "git";
}
protected override string GenerateCommandLineCommands()

View file

@ -3,6 +3,7 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using System.Runtime.InteropServices;
namespace Microsoft.DotNet.Cli.Build
{
@ -26,7 +27,9 @@ namespace Microsoft.DotNet.Cli.Build
protected override string GenerateFullPathToTool()
{
return "git";
// Workaround: https://github.com/Microsoft/msbuild/issues/1215
// There's a "git" folder on the PATH in VS 2017 Developer command prompt and it causes msbuild to fail to execute git.
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "git.exe" : "git";
}
protected override string GenerateCommandLineCommands()