param([string]$Python = 'python', [switch]$IncludeSimulator, [string]$Cache) $ErrorActionPreference = 'Stop' $root = Split-Path -Parent $PSScriptRoot $arguments = @('-X','utf8','-B', (Join-Path $root 'tools/bootstrap.py')) if ($IncludeSimulator) { $arguments += @('--only','lwtools','cocoroms','main','simulator') } if ($Cache) { $arguments += @('--cache',$Cache) } & $Python @arguments if ($LASTEXITCODE -ne 0) { throw 'Public tool/source setup failed; preserve the cache and inspect the error.' }