From 592ce1b230985aea359acdf6ed4ee84307bbedc1 Mon Sep 17 00:00:00 2001 From: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com> Date: Tue, 20 Jul 2021 15:26:30 +0200 Subject: [PATCH] Better error message when a command is not found (#1210) * Describe missing util / command error in more detail * Use more uniform language in traceInfo --- src/Runner.Sdk/Util/WhichUtil.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Runner.Sdk/Util/WhichUtil.cs b/src/Runner.Sdk/Util/WhichUtil.cs index b4d94e513..598ad0980 100644 --- a/src/Runner.Sdk/Util/WhichUtil.cs +++ b/src/Runner.Sdk/Util/WhichUtil.cs @@ -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); }