Skip to content

Commit

Permalink
add fe pre-push
Browse files Browse the repository at this point in the history
  • Loading branch information
greywen committed Dec 12, 2024
1 parent 634cbcc commit def0007
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FE/.husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if git diff --cached --name-only | grep '^src/FE/' >/dev/null;
then
cd src/FE
npm run format
else
echo "FE code no changes."
fi

exit 0

12 changes: 12 additions & 0 deletions src/FE/.husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

if git diff --cached --name-only | grep '^src/FE/' >/dev/null;
then
if ! (cd src/FE && npm run build); then
echo "The front-end build failed."
exit 1
fi
fi

exit 0

0 comments on commit def0007

Please sign in to comment.