Skip search $PATH on command with fully qualified path (#526)

This commit is contained in:
Tingluo Huang
2020-06-11 13:52:42 -04:00
committed by GitHub
parent 312c7668a8
commit 2e800f857e
2 changed files with 24 additions and 0 deletions

View File

@@ -11,6 +11,11 @@ namespace GitHub.Runner.Sdk
{
ArgUtil.NotNullOrEmpty(command, nameof(command));
trace?.Info($"Which: '{command}'");
if (Path.IsPathFullyQualified(command) && File.Exists(command))
{
trace?.Info($"Fully qualified path: '{command}'");
return command;
}
string path = Environment.GetEnvironmentVariable(PathUtil.PathVariable);
if (string.IsNullOrEmpty(path))
{