Skip to content

Commit

Permalink
ci: ensure pre-commit hook works in release script (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zidious authored Nov 7, 2022
1 parent f38d682 commit 83e8eb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/pre-commit-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi
cd ..

# For reference: https://github.com/clibs/clib/blob/master/scripts/pre-commit-hook.sh#L3-L10
function format_and_restage_file {
format_and_restage_file () {
local file="$1"
if [ -f "$file" ]; then
java -jar .cache/google-java-format-1.7-all-deps.jar --replace $file
Expand All @@ -25,4 +25,4 @@ function format_and_restage_file {
# Format each staged file ending in .java
for file in `git diff-index --cached --name-only HEAD | grep -iE '.*java$' ` ; do
format_and_restage_file "$file"
done
done

0 comments on commit 83e8eb7

Please sign in to comment.