Restore to commit 74e578279624c6045ca440a3459ebfa1f8d54191
This commit is contained in:
25
scripts/check-opencode.ps1
Normal file
25
scripts/check-opencode.ps1
Normal file
@@ -0,0 +1,25 @@
|
||||
# Simple script to validate opencode and pwsh inside running container or local environment
|
||||
param(
|
||||
[string]$ContainerName = 'wordpress-plugin-ai-builder'
|
||||
)
|
||||
|
||||
# If docker is available, run inside the container
|
||||
if (Get-Command docker -ErrorAction SilentlyContinue) {
|
||||
Write-Host "Running checks inside container: $ContainerName"
|
||||
docker compose exec $ContainerName pwsh -NoProfile -Command @"
|
||||
pwsh --version
|
||||
node --version
|
||||
opencode --version
|
||||
opencode help | Out-Null
|
||||
. /root/.config/powershell/Microsoft.PowerShell_profile.ps1
|
||||
Get-Command github | Out-Null
|
||||
exit 0
|
||||
"@
|
||||
} else {
|
||||
Write-Host "Docker is not available - trying local checks"
|
||||
pwsh --version
|
||||
node --version
|
||||
if (Get-Command opencode -ErrorAction SilentlyContinue) { opencode --version } else { Write-Error "opencode not found"; exit 1 }
|
||||
}
|
||||
|
||||
Write-Host "Checks completed." -ForegroundColor Green
|
||||
Reference in New Issue
Block a user