From 0c0116c2ef877a5d0ef9e09a77fc3746102247f0 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Wed, 7 Apr 2021 18:02:44 +0200 Subject: [PATCH] bitegra/portal/drupal/projects/portal-default#8 Add git post-checkout hook to write project and branch info to .env file --- start.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/start.sh b/start.sh index 11e4849..30b9332 100755 --- a/start.sh +++ b/start.sh @@ -246,3 +246,13 @@ if [[ -x "${L3DSHELL}" ]]; then else /usr/bin/fish fi + +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 +fi +/usr/local/bin/update-env -- GitLab