Files
cms-SiteForge/scripts/check.ps1
T

26 lines
802 B
PowerShell
Raw Normal View History

param(
[string]$Python = "python"
)
$ErrorActionPreference = "Stop"
& $Python -m pip check
if ($LASTEXITCODE -ne 0) { throw "Python dependency check failed" }
& $Python -m compileall -q app
if ($LASTEXITCODE -ne 0) { throw "Python compilation failed" }
& $Python -m pytest -q --basetemp=.pytest_cache/check-tmp
if ($LASTEXITCODE -ne 0) { throw "Pytest failed" }
if (Get-Command node -ErrorAction SilentlyContinue) {
foreach ($file in @("app/static/admin.js", "app/static/editor.js", "app/static/factory-v2.js", "app/static/pro.js")) {
& node --check $file
if ($LASTEXITCODE -ne 0) { throw "JavaScript syntax check failed: $file" }
}
} else {
Write-Warning "Node.js is unavailable; JavaScript syntax checks were skipped."
}
Write-Host "SiteForge V5 checks passed."