diff --git a/.husky/pre-commit b/.husky/pre-commit index d6f71e76..e32e31b1 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,22 +1,22 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash . "$(dirname -- "$0")/_/husky.sh" diff=$(git diff --cached --name-only) -if echo "${diff}" | grep --quiet '^site/'; then +if echo "${diff}" | grep -E --quiet '^site/'; then (cd site; yarn build) fi -if echo "${diff}" | grep --quiet '^(packages/)|(lerna)|(package.json)|(yarn.lock)'; then +if echo "${diff}" | grep -E --quiet '^(packages/)|(lerna)|(package.json)|(yarn.lock)'; then yarn yarn lint-staged yarn check-mismatches fi -if echo "${diff}" | grep --quiet '^tunnel-server/'; then +if echo "${diff}" | grep -E --quiet '^tunnel-server/'; then (cd tunnel-server; yarn lint && yarn build) fi -if echo "${diff}" | grep --quiet '^README/'; then +if echo "${diff}" | grep -E --quiet '^README/'; then npx awesome-lint fi