Files
HomeAssistant/.cursor/hooks/scripts/after-build-validate.ps1
2026-06-28 13:58:35 +03:00

25 lines
761 B
PowerShell

$input = [Console]::In.ReadToEnd()
$context = $input | ConvertFrom-Json
$command = $context.command
if (-not $command) { exit 0 }
$buildPatterns = @('dotnet build', 'dotnet run', 'dotnet publish')
$isBuildCommand = $false
foreach ($pattern in $buildPatterns) {
if ($command -match [regex]::Escape($pattern)) {
$isBuildCommand = $true
break
}
}
if (-not $isBuildCommand) { exit 0 }
$response = @{
message = "[Live Validation] Build command detected. Run live environment validation using the homeassistant MCP tools: 1) check_api to verify HA is reachable, 2) RunSmokeTest for a full health check, 3) ValidateEntities for the critical entities of the changed service."
} | ConvertTo-Json -Compress
Write-Output $response
exit 0