-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
npm run test:type | ||
npm run test:unit | ||
npm run lint:fix | ||
#!/bin/sh | ||
|
||
# Get the current branch | ||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
# Set the branch you want to skip | ||
MAIN_BRANCH="main" | ||
|
||
# Check if the current branch is different from main | ||
if [ "$CURRENT_BRANCH" != "$MAIN_BRANCH" ]; then | ||
echo "Running pre-commit hook on branch: $CURRENT_BRANCH" | ||
|
||
# Add the commands or tools you want to run here | ||
npm run test:type | ||
npm run test:unit | ||
npm run lint:fix | ||
else | ||
echo "Skipping pre-commit hook on the main branch" | ||
fi |