Oauth tests (#13)
* Moving the non-authed cfagents tests to /public * Added OAuth CF Agents tests --------- Co-authored-by: Glen Maddern <glen@glenmaddern.com>
This commit is contained in:
parent
fe65d50ec3
commit
0ea0bc48c6
1 changed files with 127 additions and 19 deletions
24
scripts/pre-commit
Executable file
24
scripts/pre-commit
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Pre-commit hook to run prettier on staged files
|
||||
# This hook is called by "git commit" and formats only the files being committed.
|
||||
|
||||
echo "Running prettier on staged files..."
|
||||
|
||||
# Get list of staged files that prettier can handle
|
||||
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(js|jsx|ts|tsx|json|css|scss|md)$' | tr '\n' ' ')
|
||||
|
||||
if [ -z "$STAGED_FILES" ]; then
|
||||
echo "No staged files need formatting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Formatting files: $STAGED_FILES"
|
||||
|
||||
# Run prettier on staged files
|
||||
pnpm prettier --write $STAGED_FILES
|
||||
|
||||
# Add the formatted files back to staging
|
||||
git add $STAGED_FILES
|
||||
|
||||
echo "Prettier formatting completed."
|
||||
Loading…
Reference in a new issue