12 lines
495 B
Bash
Executable file
12 lines
495 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Installs the repository's git hooks into this checkout (pre-push: no conflict markers, the site builds).
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/../.."
|
|
cat > .git/hooks/pre-push <<'HOOK'
|
|
#!/usr/bin/env bash
|
|
set -e
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
bash tools/ci/no-conflict-markers.sh
|
|
(cd site && node build.mjs >/dev/null) || { echo "pre-push: the site build fails; fix it before pushing" >&2; exit 1; }
|
|
HOOK
|
|
chmod +x .git/hooks/pre-push; echo "pre-push hook installed"
|