Skip to content

Commit

Permalink
setup husky prehook
Browse files Browse the repository at this point in the history
  • Loading branch information
Sun Hyuk Ahn committed Nov 11, 2023
1 parent f5dfb36 commit ba78a8f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

sh .husky/pre-commit-script.sh
3 changes: 3 additions & 0 deletions scripts/check-appconfig.sh → .husky/pre-commit-script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

# Check for AppConfig.plist
if git diff --cached --name-only | grep --quiet "AppConfig.plist"; then
echo "Error: Commit contains AppConfig.plist, which is not allowed."
exit 1
fi

5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@
"private": true,
"devDependencies": {
"husky": "^8.0.3"
},
"husky": {
"hooks": {
"pre-commit": "sh scripts/check-appconfig.sh"
}
}
}

0 comments on commit ba78a8f

Please sign in to comment.