Skip to content

Commit

Permalink
fix(githooks): git diff check
Browse files Browse the repository at this point in the history
  • Loading branch information
sobakavosne committed Nov 23, 2024
1 parent 56fa116 commit b40d5bb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/bin/sh

echo "Checking for unstaged changes..."
git diff --exit-code
EXIT_CODE=$?

if [ $EXIT_CODE -ne 0 ]; then
echo ""
echo "======================================"
echo "Unstaged changes detected. Please stage or discard changes before running this script."
echo "======================================"
echo ""
exit 1
fi

echo "No unstaged changes found."
echo ""

echo "Running scalafmt check..."
echo ""
sbt scalafmtCheckAll
Expand Down

0 comments on commit b40d5bb

Please sign in to comment.