Skip to content

Commit cfa330e

Browse files
authored
Merge pull request #117 from Devminjeong-eum/chore/DEV-37
[DEV-37] husky를 사용하여 커밋과 푸시할 때 git hooks 설정
2 parents 6455936 + 309af94 commit cfa330e

File tree

6 files changed

+739
-9
lines changed

6 files changed

+739
-9
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ node_modules
1111
dist
1212
dist-ssr
1313
*.local
14+
.eslintcache
1415

1516
# next.js
1617
/.next/

.husky/pre-commit

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 커밋 전 lint 실행
2+
npx lint-staged --verbose
3+

.husky/pre-push

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
# push하기 전에 빌드 실행
5+
npm run build
6+
if [ $? -eq 0 ]; then
7+
echo "Build completed successfully."
8+
else
9+
echo "Build failed. Aborting push."
10+
exit 1
11+
fi

0 commit comments

Comments
 (0)