[FIX] Problem with pre-commit hook that does not exist on 2.0 branchs.

This commit is contained in:
Olivier DOSSMANN 2017-12-21 14:55:39 +01:00
parent e92ea8488d
commit b8f68384a6

View File

@ -231,10 +231,12 @@ init() {
GIT_WORK_TREE="${GISSMO_DIR}/" GIT_DIR="${GISSMO_DIR}/.git/" git pull -q origin ${GIT_BRANCH} || error_and_quit "Pull command on Git repository failed." GIT_WORK_TREE="${GISSMO_DIR}/" GIT_DIR="${GISSMO_DIR}/.git/" git pull -q origin ${GIT_BRANCH} || error_and_quit "Pull command on Git repository failed."
fi fi
info "Git repository state checked." info "Git repository state checked."
# install pre-commit hook that check code validity and more # install pre-commit hook that check code validity and more (only for 1.9 branchs)
if ! test -f "${GISSMO_DIR}/.git/hooks/pre-commit"; then if ! test -f "${GISSMO_DIR}/.git/hooks/pre-commit"; then
cp "${GISSMO_DIR}/scripts/git_hooks/pre-commit" "${GISSMO_DIR}/.git/hooks/pre-commit" || error_and_quit "Failed to install pre-commit hook." if test -f "${GISSMO_DIR}/scripts/git_hooks/pre-commit"; then
info "Git repository pre-commit hook installed." cp "${GISSMO_DIR}/scripts/git_hooks/pre-commit" "${GISSMO_DIR}/.git/hooks/pre-commit" || error_and_quit "Failed to install pre-commit hook."
info "Git repository pre-commit hook installed."
fi
fi fi
source bin/activate || error_and_quit "Failed entering python virtual environment" source bin/activate || error_and_quit "Failed entering python virtual environment"
cd "$GISSMO_DIR" cd "$GISSMO_DIR"