29 lines
856 B
Bash
Executable File
29 lines
856 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Git pre-push hook: chay bo hoi quy truoc khi day.
|
|
#
|
|
# CAI DAT (khi repo da co .git):
|
|
# ln -s ../../tools/pre-push .git/hooks/pre-push
|
|
#
|
|
# Bo qua mot lan: git push --no-verify
|
|
#
|
|
# Hook nay CHI chay lai ban ghi co san; no khong ghi lai .vsr. Neu ban vua
|
|
# doi bo mo phong thi phai tu chay `tools/regress.sh --record --bless` va
|
|
# DOC ky hieu so thay doi truoc khi commit file ky vong moi.
|
|
|
|
set -e
|
|
ROOT=$(git rev-parse --show-toplevel)
|
|
cd "$ROOT"
|
|
|
|
if [ ! -x build/tools/vslam_replay ]; then
|
|
echo "pre-push: chua build vslam_replay -- bo qua bo hoi quy" >&2
|
|
exit 0
|
|
fi
|
|
|
|
# Ban ghi khong nam trong git (55 MB). Khong co thi sinh lai -- tat dinh.
|
|
if [ -z "$(ls test/data/vsr/*.vsr 2>/dev/null)" ]; then
|
|
echo "pre-push: chua co ban ghi, dang sinh lai..."
|
|
./tools/regress.sh --record >/dev/null || exit 1
|
|
fi
|
|
|
|
exec ./tools/regress.sh
|