validateRequiredTools static method

ValidationResult<bool> validateRequiredTools(
  1. Map<String, String> tools
)

Validates that required tools are available.

Checks for the presence of specified command-line tools that are required for command execution.

Parameters:

  • tools: Map of tool names to installation commands

Returns: ValidationResult indicating tool availability

Implementation

static ValidationResult<bool> validateRequiredTools(
    Map<String, String> tools) {
  for (final entry in tools.entries) {
    final toolName = entry.key;
    final installCommand = entry.value;

    if (which(toolName).notfound) {
      return ValidationResult.error(
        '$toolName command-line tool not found',
        suggestion: 'Install $toolName to use this feature',
        examples: [installCommand],
      );
    }
  }

  return ValidationResult.success(true);
}