ndurner commited on
Commit
a1303c3
·
1 Parent(s): 4353f5a

README regeneration hook

Browse files
Files changed (2) hide show
  1. .githooks/pre-commit +9 -0
  2. scripts/setup-git-hooks.sh +11 -0
.githooks/pre-commit ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ # run welcome README update when README.md changed
6
+ if git diff --cached --name-only | grep -qxF README.md; then
7
+ python3 .github/generate_welcome_readme.py
8
+ git add .github/README_welcome.md
9
+ fi
scripts/setup-git-hooks.sh ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ if ! git status >/dev/null 2>&1; then
6
+ echo "error: this script must be run from the repository root" >&2
7
+ exit 1
8
+ fi
9
+
10
+ git config core.hooksPath .githooks
11
+ echo "Configured git to use .githooks/pre-commit (run this once per clone)."