mirror of
https://github.com/SK8-ENGINE/skate-3-rust-engine.git
synced 2026-10-26 19:47:44 +00:00
Retain focused regression coverage and consolidate build/launch scripts with release workflow updates. Validated game build and four regressions including 5400 simulation ticks.
29 lines
1.5 KiB
PowerShell
29 lines
1.5 KiB
PowerShell
param([string]$Map)
|
|
$ProjectRoot = Split-Path $PSScriptRoot -Parent
|
|
$ErrorActionPreference = 'Stop'
|
|
Push-Location $ProjectRoot
|
|
try {
|
|
$executable = Join-Path $ProjectRoot 'bin/skate3rust.exe'
|
|
if (-not (Test-Path -LiteralPath $executable)) { throw 'Game is not built. Run BUILD.bat first.' }
|
|
New-Item -ItemType Directory -Path (Join-Path $ProjectRoot 'logs') -Force | Out-Null
|
|
$log = Join-Path $ProjectRoot ('logs/game-' + (Get-Date -Format 'yyyyMMdd-HHmmss') + '.log')
|
|
Write-Host 'Starting Skate 3 Rust Engine. Use your XInput controller; Esc opens difficulty/graphics/pause settings.'
|
|
Write-Host "Log: $log"
|
|
$errorLog = [System.IO.Path]::ChangeExtension($log, 'stderr.log')
|
|
$assetArgument = '"' + (Join-Path $ProjectRoot 'assets') + '"'
|
|
$gameArguments = @('--assets', $assetArgument)
|
|
if ($Map) {
|
|
$mapPath = (Resolve-Path -LiteralPath $Map).Path
|
|
if ([System.IO.Path]::GetExtension($mapPath) -ine '.skate') { throw 'Select a .skate map file.' }
|
|
$gameArguments += @('--map', ('"' + $mapPath + '"'))
|
|
Write-Host "Map: $mapPath"
|
|
}
|
|
$game = Start-Process -FilePath $executable -WorkingDirectory $ProjectRoot `
|
|
-ArgumentList $gameArguments -NoNewWindow -Wait -PassThru `
|
|
-RedirectStandardOutput $log -RedirectStandardError $errorLog
|
|
if ($game.ExitCode -ne 0) {
|
|
Get-Content -LiteralPath $errorLog -Tail 30
|
|
throw "Game exited with code $($game.ExitCode). Log: $errorLog"
|
|
}
|
|
} finally { Pop-Location }
|