agtest/run.ps1
2021-09-30 15:59:03 -05:00

16 lines
No EOL
494 B
PowerShell

#blessed https://stackoverflow.com/a/52784160
function Invoke-Call {
param (
[scriptblock]$ScriptBlock,
[string]$ErrorAction = $ErrorActionPreference
)
& @ScriptBlock
if (($lastexitcode -ne 0) -and $ErrorAction -eq "Stop") {
exit $lastexitcode
}
}
Invoke-Call -ScriptBlock {mypy (get-item *.py) } -ErrorAction Stop
Invoke-Call -ScriptBlock {python agmain.py } -ErrorAction Stop
Invoke-Call -ScriptBlock {mypy (get-item gen/*.py) } -ErrorAction Stop