aboutsummaryrefslogtreecommitdiff
path: root/bin/check_index
blob: 77bdb029e78f2e1f6dbc22d9f5f06132e608b5e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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/"
./bin/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