Enable custom scripts to run on Git hooks
This commit is contained in:
parent
124a1ea509
commit
1d46919f6a
|
@ -19,6 +19,7 @@ UpgradeLog.htm
|
||||||
*.opendb
|
*.opendb
|
||||||
|
|
||||||
/Dist/*.zip
|
/Dist/*.zip
|
||||||
|
/Dist/git_hooks/*.local.ps1
|
||||||
|
|
||||||
# mupen64plus-win32-deps is a submodule, so ignores should be in that repo
|
# mupen64plus-win32-deps is a submodule, so ignores should be in that repo
|
||||||
/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/docs
|
/libmupen64plus/mupen64plus-win32-deps/SDL-1.2.14/docs
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
dotnet pwsh "./Dist/git_hooks/$(basename "$0").ps1" "$@"
|
kind="$(basename "$0")"
|
||||||
|
dotnet pwsh "./Dist/git_hooks/$kind.ps1" "$@"
|
||||||
|
if [ -e "./Dist/git_hooks/$kind.local.ps1" ]; then dotnet pwsh "./Dist/git_hooks/$kind.local.ps1" "$@"; fi
|
||||||
|
|
|
@ -10,7 +10,6 @@ if (Test-Path $targetDir -PathType Container) { # is Git repo
|
||||||
} elseif ($(Get-FileHash $target).Hash -ne $(Get-FileHash $f.FullName).Hash) { # files differ
|
} elseif ($(Get-FileHash $target).Hash -ne $(Get-FileHash $f.FullName).Hash) { # files differ
|
||||||
$head = Get-Content $target -TotalCount 3
|
$head = Get-Content $target -TotalCount 3
|
||||||
echo "[$PSCommandFilename] found existing Git hook $($f.Name), please resolve conflict manually"
|
echo "[$PSCommandFilename] found existing Git hook $($f.Name), please resolve conflict manually"
|
||||||
#TODO should REALLY make the scripts extensible then...
|
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
# else no-op
|
# else no-op
|
||||||
|
|
Loading…
Reference in New Issue