mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-02 13:12:44 +00:00
docs(githooks): replace pre-push hook with pre-commit and update documentation
This commit is contained in:
1 parent
7d57faa958
commit
2a925f6a9a
2 files changed
+1
-19
No files matched your search
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Pre-push: the docs pages under apps/docs/content are generated from work/1
|
||||
# by `bun run sync`, and deploy.yml publishes whatever main holds. Regenerate
|
||||
# them now and refuse the push if the result differs from the tree, so a
|
||||
# solution never lands without its page (or with a stale `## Solution`).
|
||||
#
|
||||
# Bypass for a deliberate partial push: git push --no-verify
|
||||
set -eu
|
||||
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
report=$(bun run --silent sync)
|
||||
|
||||
changed=$(git status --porcelain -- apps/docs/content)
|
||||
if [ -n "$changed" ]; then
|
||||
printf '%s\n' "$report" | grep -v 'skipped (in sync)' >&2
|
||||
printf '\npre-push: apps/docs/content is out of sync with work/1 — commit the regenerated pages:\n%s\n' "$changed" >&2
|
||||
exit 1
|
||||
fi
|
||||
Reference in new issue
Block a user