Skip to content

Commit

Permalink
precommit hook preventing appconfig commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sun Hyuk Ahn committed Nov 11, 2023
1 parent 2b6824d commit e97d7bd
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
31 changes: 31 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "x",
"version": "1.0.0",
"private": true,
"devDependencies": {
"husky": "^8.0.3"
},
"husky": {
"hooks": {
"pre-commit": "sh scripts/check-appconfig.sh"
}
}
}
5 changes: 5 additions & 0 deletions scripts/check-appconfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
if git diff --cached --name-only | grep --quiet "AppConfig.plist"; then
echo "Error: Commit contains AppConfig.plist, which is not allowed."
exit 1
fi

0 comments on commit e97d7bd

Please sign in to comment.