| param( | |
| [Parameter(Position = 0)] | |
| [ValidateSet("build", "source", "check")] | |
| [string]$Command = "build", | |
| [Parameter(Position = 1)] | |
| [ValidateRange(1, 64)] | |
| [int]$Jobs = [Math]::Min([Math]::Max([Environment]::ProcessorCount - 1, 1), 8) | |
| ) | |
| if ($Command -eq "check") { | |
| Write-Error "Use node tools/validate.mjs" | |
| exit 1 | |
| } | |
| $ErrorActionPreference = "Stop" | |
| $script = Join-Path $PSScriptRoot "localisation.mjs" | |
| & node $script $Command --jobs $Jobs | |
| if ($LASTEXITCODE -ne 0) { | |
| throw "Localisation '$Command' failed." | |
| } | |