diff --git a/source/Nuke.Tooling/ToolTasks.Run.cs b/source/Nuke.Tooling/ToolTasks.Run.cs index 0d72e7a3b..79db7f372 100644 --- a/source/Nuke.Tooling/ToolTasks.Run.cs +++ b/source/Nuke.Tooling/ToolTasks.Run.cs @@ -12,9 +12,9 @@ namespace Nuke.Common.Tooling; partial class ToolTasks { - protected virtual IReadOnlyCollection Run(ToolOptions options) + protected virtual partial IReadOnlyCollection Run(ToolOptions options) { - var secrets = options.GetSecrets().ToList(); + var secrets = options?.GetSecrets().ToList() ?? []; string Filter(string text) => secrets.Aggregate(text, (str, s) => str.Replace(s, "[REDACTED]")); options = PreProcess(options); @@ -35,7 +35,7 @@ protected virtual IReadOnlyCollection Run(ToolOptions options) return process.Output; } - protected virtual (TResult Result, IReadOnlyCollection Output) Run(ToolOptions options) + protected virtual partial (TResult Result, IReadOnlyCollection Output) Run(ToolOptions options) { var output = Run(options); try diff --git a/source/Nuke.Tooling/ToolTasks.cs b/source/Nuke.Tooling/ToolTasks.cs index fca2dd3e8..5d2c900ee 100644 --- a/source/Nuke.Tooling/ToolTasks.cs +++ b/source/Nuke.Tooling/ToolTasks.cs @@ -17,6 +17,8 @@ public abstract partial class ToolTasks protected internal virtual partial Action GetLogger(ToolOptions options = null); protected virtual partial string GetToolPath(ToolOptions options = null); + protected virtual partial IReadOnlyCollection Run(ToolOptions options = null); + protected virtual partial (TResult Result, IReadOnlyCollection Output) Run(ToolOptions options = null); protected virtual partial Func GetExitHandler(ToolOptions options = null); protected virtual ToolOptions PreProcess(ToolOptions options) => options;