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

#100 Configure git hook only if git got initialized

parent e1e11cd0
No related branches found
No related tags found
No related merge requests found
...@@ -242,13 +242,15 @@ fi ...@@ -242,13 +242,15 @@ fi
restoreEnvFile restoreEnvFile
# Configure Git Hook # Configure Git Hook
if [[ ! -f .git/hooks/post-checkout ]]; then if [[ -d .git ]]; then
echo "#!/bin/sh" > .git/hooks/post-checkout if [[ ! -f .git/hooks/post-checkout ]]; then
chmod +x .git/hooks/post-checkout echo "#!/bin/sh" > .git/hooks/post-checkout
fi chmod +x .git/hooks/post-checkout
HOOK_DEFINED=$(grep /usr/local/bin/update-env .git/hooks/post-checkout) fi
if [[ "$HOOK_DEFINED" = "" ]]; then HOOK_DEFINED=$(grep /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 if [[ "$HOOK_DEFINED" = "" ]]; then
echo "docker exec ${COMPOSE_PROJECT_NAME}_l3d /usr/local/bin/update-env" >> .git/hooks/post-checkout
fi
fi fi
/usr/local/bin/update-env /usr/local/bin/update-env
......
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