From a05dd493c8e37152a7d42bb60bf692ae1f5743b5 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Tue, 13 Apr 2021 15:10:28 +0200 Subject: [PATCH] Configure Git hook eralier, before starting the shell Call update-env git hook script through docker to also make it available for IDEs --- start.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/start.sh b/start.sh index 30b9332..6653f74 100755 --- a/start.sh +++ b/start.sh @@ -241,18 +241,19 @@ if [[ -d /drupal/.idea ]]; then fi restoreEnvFile -if [[ -x "${L3DSHELL}" ]]; then - ${L3DSHELL} -else - /usr/bin/fish -fi - +# Configure Git Hook if [[ ! -f .git/hooks/post-checkout ]]; then echo "#!/bin/sh" > .git/hooks/post-checkout chmod +x .git/hooks/post-checkout fi HOOK_DEFINED=$(grep /usr/local/bin/update-env .git/hooks/post-checkout) if [[ "$HOOK_DEFINED" = "" ]]; then - echo "/usr/local/bin/update-env" >> .git/hooks/post-checkout + echo "docker exec ${COMPOSE_PROJECT_NAME}_l3d /usr/local/bin/update-env" >> .git/hooks/post-checkout fi /usr/local/bin/update-env + +if [[ -x "${L3DSHELL}" ]]; then + ${L3DSHELL} +else + /usr/bin/fish +fi -- GitLab