16 lines
No EOL
506 B
PowerShell
16 lines
No EOL
506 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 gen.py } -ErrorAction Stop
|
|
Invoke-Call -ScriptBlock {mypy (get-item gen/*.py) } -ErrorAction Stop |