File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 22
33. " $( dirname -- " $0 " ) /_/husky.sh"
44
5- echo " *** Checking for lint violations in changed files ***************"
6- echo
5+ # If the push refs start with (delete), then we're deleting a branch, so skip the pre-push hook
6+ # Source: <https://github.com/typicode/husky/issues/169#issuecomment-1719263454>
7+ stdin=$( cat -)
8+ if echo " $stdin " | grep -q " ^(delete)" ; then
9+ exit 0
10+ fi
11+
12+ files_to_check=$( git diff --cached " $( git merge-base main HEAD) " --name-only --diff-filter=d)
13+ if [[ -n $files_to_check ]]; then
14+ echo " *** Checking for lint violations in changed files ***************"
15+ echo
716
8- yarn prettier --check --ignore-unknown $( git diff --cached " $( git merge-base main HEAD) " --name-only --diff-filter=d) || exit $?
17+ yarn prettier --check --ignore-unknown $files_to_check || exit $?
18+ fi
919
1020echo
1121echo " *** Auditing dependencies ***************"
You can’t perform that action at this time.
0 commit comments