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
restoreEnvFile
# 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 "docker exec ${COMPOSE_PROJECT_NAME}_l3d /usr/local/bin/update-env" >> .git/hooks/post-checkout
if [[ -d .git ]]; then
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 "docker exec ${COMPOSE_PROJECT_NAME}_l3d /usr/local/bin/update-env" >> .git/hooks/post-checkout
fi
fi
/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