Interface ICommandExecutor
Interface for executing CLI commands. Implementations include ProcessRunner (local) and ContainerExecutor (Docker). This abstraction enables ANDO to run the same build logic in different environments.
public interface ICommandExecutor
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.
Task<CommandResult> ExecuteAsync(string command, string[] args, CommandOptions? options = null)
Parameters
commandstringThe command to execute (e.g., "dotnet")
argsstring[]Command arguments
optionsCommandOptionsOptional 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.
bool IsAvailable(string command)
Parameters
commandstring