From b8f68384a665d0b2830baf9d78617ec26a42f410 Mon Sep 17 00:00:00 2001 From: Olivier DOSSMANN Date: Thu, 21 Dec 2017 14:55:39 +0100 Subject: [PATCH] [FIX] Problem with pre-commit hook that does not exist on 2.0 branchs. --- launch.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/launch.sh b/launch.sh index b3baaf2..2d6026c 100755 --- a/launch.sh +++ b/launch.sh @@ -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." fi 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 - 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." + if test -f "${GISSMO_DIR}/scripts/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." + info "Git repository pre-commit hook installed." + fi fi source bin/activate || error_and_quit "Failed entering python virtual environment" cd "$GISSMO_DIR"