Skip to content

Commit

Permalink
chore: Refactor pre-commit hook to improve performance and readability
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Sep 23, 2024
1 parent 12a0d71 commit 21a5b4c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
15 changes: 14 additions & 1 deletion hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,18 @@ if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then
exec < /dev/tty
fi

# Get list of stashed PHP files
stashed_files=$(git diff --cached --name-only --diff-filter=ACM -- '*.php')

# If there are no stashed PHP files, exit early
if [ -z "$stashed_files" ]; then
exit 0
fi

# Set files variable to only include stashed PHP files
files="$stashed_files"

$(pwd)/vendor/bin/pint $files -q
git add .
if [ $? -eq 0 ]; then
git add $files
fi
6 changes: 3 additions & 3 deletions other/nightly/versions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"coolify": {
"v4": {
"version": "4.0.0-beta.339"
"version": "4.0.0-beta.341"
},
"nightly": {
"version": "4.0.0-beta.340"
"version": "4.0.0-beta.342"
},
"helper": {
"version": "1.0.1"
Expand All @@ -13,4 +13,4 @@
"version": "1.0.1"
}
}
}
}

0 comments on commit 21a5b4c

Please sign in to comment.