Table of Contents

Class CommandExecutorBase

Namespace
Ando.Execution
Assembly
ando.dll

Base class for command executors that provides shared process execution logic. Subclasses implement PrepareProcessStartInfo(string, string[], CommandOptions) to customize command setup.

public abstract class CommandExecutorBase : ICommandExecutor
Inheritance
CommandExecutorBase
Implements
Derived
Inherited Members

Constructors

CommandExecutorBase(IBuildLogger)

protected CommandExecutorBase(IBuildLogger logger)

Parameters

logger IBuildLogger

Fields

Logger

protected readonly IBuildLogger Logger

Field Value

IBuildLogger

Methods

ExecuteAsync(string, string[], CommandOptions?)

Executes a command with real-time output streaming. Output is streamed to the logger as it's produced by the command.

public Task<CommandResult> ExecuteAsync(string command, string[] args, CommandOptions? options = null)

Parameters

command string

The command to execute (e.g., "dotnet")

args string[]

Command arguments

options CommandOptions

Optional execution options

Returns

Task<CommandResult>

Result containing exit code and success status

IsAvailable(string)

Checks if a command/tool is available in the execution environment. Used to provide helpful error messages before attempting execution.

public abstract bool IsAvailable(string command)

Parameters

command string

Returns

bool

LogCommand(string, string[], CommandOptions)

Logs the command being executed for debugging and troubleshooting. This helps users see exactly what commands are run and reproduce issues.

protected virtual void LogCommand(string command, string[] args, CommandOptions options)

Parameters

command string
args string[]
options CommandOptions

PrepareProcessStartInfo(string, string[], CommandOptions)

Prepares the ProcessStartInfo for command execution. Subclasses override this to customize the command setup (e.g., wrapping in docker exec).

protected abstract ProcessStartInfo PrepareProcessStartInfo(string command, string[] args, CommandOptions options)

Parameters

command string
args string[]
options CommandOptions

Returns

ProcessStartInfo