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
|
2021-06-09 06:33:53 +00:00
|
|
|
Invoke-Call -ScriptBlock {mypy (get-item gen/*.py) } -ErrorAction Stop
|