agtest/run.ps1

16 lines
494 B
PowerShell
Raw Normal View History

2021-09-30 20:59:03 +00:00
#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