From fedfa65156a3608e7f7411b70eb85218c0823ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bech=20Christensen?= Date: Wed, 1 Jan 2025 12:21:02 +0100 Subject: [PATCH] #1491 Do not list unlisted targets in error message --- source/Nuke.Build/Execution/ExecutionPlanner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Nuke.Build/Execution/ExecutionPlanner.cs b/source/Nuke.Build/Execution/ExecutionPlanner.cs index 943dffa36..0addec2ae 100644 --- a/source/Nuke.Build/Execution/ExecutionPlanner.cs +++ b/source/Nuke.Build/Execution/ExecutionPlanner.cs @@ -105,7 +105,7 @@ private static ExecutableTarget GetExecutableTarget( if (executableTarget == null) { Assert.Fail($"Target with name {targetName.SingleQuote()} does not exist. Available targets are:" - .Concat(executableTargets.Select(x => $" - {x.Name}").OrderBy(x => x)) + .Concat(executableTargets.Where(x => x.Listed).Select(x => $" - {x.Name}").OrderBy(x => x)) .JoinNewLine()); }