Move AStyleHelper to the .github folder

This commit is contained in:
Duncan Ogilvie 2024-08-05 15:52:36 +02:00
parent 382f4b227d
commit 625b28823a
8 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
@echo off
echo Run this to install the auto-format hook.
git config core.autocrlf false
copy hooks\pre-commit .git\hooks\pre-commit
copy %~dp0pre-commit %~dp0..\..\.git\hooks\pre-commit

View File

@ -4,13 +4,13 @@
#
#check if the formatter is present
if [ ! -f ./hooks/AStyleHelper.exe ]; then
if [ ! -f ./.github/format/AStyleHelper.exe ]; then
echo "AStyleHelper not found!"
exit 0
fi
#format the code
"./hooks/AStyleHelper.exe" Silent
"./.github/format/AStyleHelper.exe" Silent
#exit when nothing needs to be done
if [ $? == 0 ]; then
@ -28,6 +28,6 @@ fi
#cancel commit if the changes were undone by the formatting
gitFiles=$(git diff-index --name-only --cached HEAD)
if [ -z "$gitFiles" ]; then
"./hooks/AStyleHelper.exe" "After formatting, no files were staged..."
"./.github/AStyleHelper.exe" "After formatting, no files were staged..."
exit 1
fi

View File

@ -1,2 +1,3 @@
@echo off
hooks\AStyleHelper.exe Silent
git config core.autocrlf false
%~dp0.github\format\AStyleHelper.exe Silent