Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .githooks/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env sh
# Point git at the versioned hooks. Non-fatal outside a git work tree
# (tarball installs, CI cache restores) but loud about what it did, so a
# contributor never silently ends up with inactive hooks.
set -eu

if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "[hooks] skipped: not a git work tree"
exit 0
fi

git config core.hooksPath .githooks
echo "[hooks] core.hooksPath set to .githooks"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint:fix": "eslint . --fix",
"seed": "dotenv -e .env.local -- tsx prisma/seed.ts",
"postinstall": "prisma generate",
"prepare": "git config core.hooksPath .githooks 2>/dev/null || true",
"prepare": "sh .githooks/install.sh",
"seed:dev": "dotenv -e .env.local -- tsx prisma/seed.dev.ts"
},
"dependencies": {
Expand Down