Skip to content
Snippets Groups Projects
Commit a05dd493 authored by jurgenhaas's avatar jurgenhaas
Browse files

Configure Git hook eralier, before starting the shell

Call update-env git hook script through docker to also make it available for IDEs
parent 767e2b85
No related branches found
No related tags found
No related merge requests found
...@@ -241,18 +241,19 @@ if [[ -d /drupal/.idea ]]; then ...@@ -241,18 +241,19 @@ if [[ -d /drupal/.idea ]]; then
fi fi
restoreEnvFile restoreEnvFile
if [[ -x "${L3DSHELL}" ]]; then # Configure Git Hook
${L3DSHELL}
else
/usr/bin/fish
fi
if [[ ! -f .git/hooks/post-checkout ]]; then if [[ ! -f .git/hooks/post-checkout ]]; then
echo "#!/bin/sh" > .git/hooks/post-checkout echo "#!/bin/sh" > .git/hooks/post-checkout
chmod +x .git/hooks/post-checkout chmod +x .git/hooks/post-checkout
fi fi
HOOK_DEFINED=$(grep /usr/local/bin/update-env .git/hooks/post-checkout) HOOK_DEFINED=$(grep /usr/local/bin/update-env .git/hooks/post-checkout)
if [[ "$HOOK_DEFINED" = "" ]]; then 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 fi
/usr/local/bin/update-env /usr/local/bin/update-env
if [[ -x "${L3DSHELL}" ]]; then
${L3DSHELL}
else
/usr/bin/fish
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment