Better error message when a command is not found (#1210)

* Describe missing util / command error in more detail

* Use more uniform language in traceInfo
This commit is contained in:
Ferenc Hammerl
2021-07-20 15:26:30 +02:00
committed by GitHub
parent fff31e11c5
commit 592ce1b230

View File

@@ -115,11 +115,15 @@ namespace GitHub.Runner.Sdk
}
}
trace?.Info("Not found.");
#if OS_WINDOWS
trace?.Info($"{command}: command not found. Make sure '{command}' is installed and its location included in the 'Path' environment variable.");
#else
trace?.Info($"{command}: command not found. Make sure '{command}' is installed and its location included in the 'PATH' environment variable.");
#endif
if (require)
{
throw new FileNotFoundException(
message: $"File not found: '{command}'",
message: $"{command}: command not found",
fileName: command);
}