diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-30 14:04:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 14:04:47 +0200 |
commit | 5e772885025225653b2a5766ec41fa344c2ebe3e (patch) | |
tree | 939caf6cc35fd5e58bbd46fdadcf2c110e7118e2 | |
parent | 889c522a1954a11df93e3db59f61e41967c099d7 (diff) | |
parent | 4bf03afe8b70062cfca3336527294171e538ce25 (diff) |
Merge pull request #65075 from RandomShaper/hooks_wt_win
-rwxr-xr-x | misc/hooks/pre-commit-black | 4 | ||||
-rwxr-xr-x | misc/hooks/pre-commit-clang-format | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/misc/hooks/pre-commit-black b/misc/hooks/pre-commit-black index fd93bfe73c..b7335685ae 100755 --- a/misc/hooks/pre-commit-black +++ b/misc/hooks/pre-commit-black @@ -70,7 +70,7 @@ if [ ! -x "$BLACK" ] ; then $XMSG -center -title "Error" "Error: black executable not found." exit 1 elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then - winmessage="$(canonicalize_filename "./.git/hooks/winmessage.ps1")" + winmessage="$(canonicalize_filename "$(dirname -- "$0")/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -center -title "Error" --text "Error: black executable not found." exit 1 fi @@ -160,7 +160,7 @@ while true; do yn="N" fi elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then - winmessage="$(canonicalize_filename "./.git/hooks/winmessage.ps1")" + winmessage="$(canonicalize_filename "$(dirname -- "$0")/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?" choice=$? if [ "$choice" = "100" ] ; then diff --git a/misc/hooks/pre-commit-clang-format b/misc/hooks/pre-commit-clang-format index e8e62e6470..44b6f59132 100755 --- a/misc/hooks/pre-commit-clang-format +++ b/misc/hooks/pre-commit-clang-format @@ -90,7 +90,7 @@ if [ ! -x "$CLANG_FORMAT" ] ; then $XMSG -center -title "Error" "$message" exit 1 elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then - winmessage="$(canonicalize_filename "./.git/hooks/winmessage.ps1")" + winmessage="$(canonicalize_filename "$(dirname -- "$0")/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -center -title "Error" --text "$message" exit 1 fi @@ -200,7 +200,7 @@ while true; do yn="N" fi elif [ \( \( "$OSTYPE" = "msys" \) -o \( "$OSTYPE" = "win32" \) \) -a \( -x "$PWSH" \) ]; then - winmessage="$(canonicalize_filename "./.git/hooks/winmessage.ps1")" + winmessage="$(canonicalize_filename "$(dirname -- "$0")/winmessage.ps1")" $PWSH -noprofile -executionpolicy bypass -file "$winmessage" -file "$patch" -buttons "Apply":100,"Apply and stage":200,"Do not apply":0 -center -default "Do not apply" -geometry 800x600 -title "Do you want to apply that patch?" choice=$? if [ "$choice" = "100" ] ; then |