Make Git hooks print message when PowerShell not found
This commit is contained in:
parent
f3ae45b7bd
commit
afd496a185
|
@ -1,7 +1,10 @@
|
|||
#!/bin/sh
|
||||
kind="$(basename "$0")"
|
||||
pwsh="$(command -v pwsh)"
|
||||
if [ -z "$pwsh" ]; then pwsh="$(command -v dotnet) pwsh"; fi
|
||||
if ! ("$pwsh" -v >/dev/null 2>/dev/null); then exit 0; fi
|
||||
kind="$(basename "$0")"
|
||||
if ! ("$pwsh" -v >/dev/null 2>/dev/null); then
|
||||
printf "pwsh not found in PATH; skipping %s hook\n" "$kind"
|
||||
exit 0
|
||||
fi
|
||||
"$pwsh" "./Dist/git_hooks/$kind.ps1" "$@" || exit $?
|
||||
if [ -e "./Dist/git_hooks/$kind.local.ps1" ]; then "$pwsh" "./Dist/git_hooks/$kind.local.ps1" "$@" || exit $?; fi
|
||||
|
|
Loading…
Reference in New Issue