-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove lint-staged from root and update script.
- remove lint-staged that was accidentally installed on root instead of coral. - add lint-staged package to coral - add script to package.json - update pre-commit script to always change to git-root/coral - use variable for frontend-root to make it easier to change that later - remove echo - use --prefix instead of changing directory
- Loading branch information
1 parent
a8f7e56
commit 3b55942
Showing
5 changed files
with
295 additions
and
506 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,12 +1,12 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
FRONTEND_ROOT="coral" | ||
GIT_ROOT=$(git rev-parse --show-toplevel) | ||
STAGED_FILES=$(git diff --staged --name-only) | ||
|
||
if echo "$STAGED_FILES" | grep -q coral; | ||
if echo "$STAGED_FILES" | grep -q "$FRONTEND_ROOT"; | ||
then | ||
echo 'Files on coral staged' | ||
cd coral || return | ||
pnpm lint-staged | ||
pnpm test --bail | ||
fi | ||
pnpm --prefix="$GIT_ROOT"/"$FRONTEND_ROOT" lint-staged | ||
pnpm --prefix="$GIT_ROOT"/"$FRONTEND_ROOT" test --bail | ||
fi |
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
Oops, something went wrong.