aboutsummaryrefslogtreecommitdiff
path: root/bin/check_index
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2023-10-18 08:25:38 -0400
committerNick Mathewson <nickm@torproject.org>2023-10-18 08:25:38 -0400
commit16a65bab070f6be294d486020da19de0ce96b412 (patch)
treefa6a7fb563090c90d6ab7231b9ac8aee515dedac /bin/check_index
parent644db3554745164d7df2c05d246aaa849a1c16b4 (diff)
downloadtorspec-16a65bab070f6be294d486020da19de0ce96b412.tar.gz
torspec-16a65bab070f6be294d486020da19de0ce96b412.zip
Move all binaries to a "bin" directory.
Diffstat (limited to 'bin/check_index')
-rwxr-xr-xbin/check_index22
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/check_index b/bin/check_index
new file mode 100755
index 0000000..61db50d
--- /dev/null
+++ b/bin/check_index
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+#
+# Give an error if somebody forgot to run ./reindex.py.
+#
+# Only works on a clean git checkout.
+
+set -e -u -o pipefail -x
+
+TOPLEVEL=$(dirname "$0")/..
+
+if ! git diff --quiet ; then
+ echo "Git repository is not clean. Cannot procede."
+ exit 2
+fi
+
+cd "$TOPLEVEL/proposals"
+./reindex.py
+
+if ! git diff --quiet ; then
+ echo "Proposal index is not up-to-date. Run ./reindex.py to regenerate it." >&2
+ exit 1
+fi