-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathpre-commit
More file actions
executable file
·30 lines (23 loc) · 891 Bytes
/
pre-commit
File metadata and controls
executable file
·30 lines (23 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#Abort on first error
set -e
#Get the list of staged files
staged_files=$(git diff --cached --name-only)
#Check if any file is in the kleros-app directory and if so, check types
if echo "$staged_files" | grep -q "^kleros-app/"; then
yarn workspace @kleros/kleros-app check-types
fi
#Check if any file is in the kleros-sdk directory and if so, check types
if echo "$staged_files" | grep -q "^kleros-sdk/"; then
yarn workspace @kleros/kleros-sdk check-types
fi
#Check if any file is in the web-devtools directory and if so, check types
if echo "$staged_files" | grep -q "^web-devtools/"; then
yarn workspace @kleros/kleros-v2-web-devtools check-types
fi
#Check if any file is in the web directory and if so, check types
if echo "$staged_files" | grep -q "^web/"; then
yarn workspace @kleros/kleros-v2-web check-types
fi
yarn lint-staged