mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00

* Fix typos (`the the` > `the`) It looks like humans aren't only very bad at recognizing a double `the` in a sentence when reading [1], but they're also very good at sneaking them in unintentionally without noticing. Fix this by running: ``` ack --ignore-dir=doc/man --ignore-dir=doc/topics/releases -i 'the the\W' -l | xargs sed -i 's|the the\(\W\)|the\1|g' ``` [1] Eye movements and word skipping during reading: Effects of word length and predictability: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3543826/ * Blacken changed files * Blacken changed files * Re-add unintentional delete * Bad merge fix * Fix broken docstring * Another try * pre-commit should pass now? Co-authored-by: Daniel A. Wozniak <dwozniak@saltstack.com> Co-authored-by: Wayne Werner <wwerner@saltstack.com>
26 lines
857 B
PowerShell
26 lines
857 B
PowerShell
Function Start_Process_and_test_exitcode {
|
|
|
|
# This function is a wrapper for Start-Process that checks the exitcode
|
|
# It receives 3 parameters:
|
|
# $fun - the process that shall be started
|
|
# $args - the arguments of $fun
|
|
# $descr - the short description shown in the case of an error
|
|
|
|
Param(
|
|
[Parameter(Mandatory=$true)] [String] $fun,
|
|
[Parameter(Mandatory=$true)] [String] $args,
|
|
[Parameter(Mandatory=$true)] [String] $descr
|
|
)
|
|
|
|
Begin { Write-Host "Executing Command: $fun $args" }
|
|
|
|
Process {
|
|
$p = Start-Process "$fun" -ArgumentList "$args" -Wait -NoNewWindow -PassThru
|
|
If ($p.ExitCode -ne 0) {
|
|
Write-Error "$descr returned exitcode $p.ExitCode."
|
|
exit $p.ExitCode
|
|
}
|
|
}
|
|
|
|
End { Write-Host "Finished Executing Command: $fun $args" }
|
|
}
|