Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LakeDropsDrupalDev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Docker
LakeDropsDrupalDev
Commits
7b2da54b
Commit
7b2da54b
authored
2 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Do not create ahoy and env files for dot-projects
parent
9d77fd0d
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
Develop
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
start.sh
+26
-20
26 additions, 20 deletions
start.sh
with
26 additions
and
20 deletions
start.sh
+
26
−
20
View file @
7b2da54b
...
...
@@ -27,6 +27,9 @@ function truncateCurrentDirectory {
}
function
restoreEnvFile
{
if
[[
"
${
COMPOSE_PROJECT_NAME
}
"
==
"."
]]
;
then
return
fi
if
[[
-n
${
PHP_VERSION
}
]]
;
then
echo
"PHP_VERSION=
${
PHP_VERSION
}
"
>>
.env
fi
...
...
@@ -235,31 +238,34 @@ else
l3dComposer
fi
setupAhoy
if
[[
-d
/drupal/.idea
]]
;
then
/usr/local/bin/.configIdea
fi
restoreEnvFile
# Configure Git Hook
if
[[
-d
.git
]]
;
then
if
[[
!
-d
.git/hooks
]]
;
then
mkdir
-p
.git/hooks
fi
if
[[
!
-f
.git/hooks/post-checkout
]]
;
then
echo
"#!/bin/sh"
>
.git/hooks/post-checkout
chmod
+x .git/hooks/post-checkout
fi
OLDCOMMAND
=
'docker exec '
${
COMPOSE_PROJECT_NAME
}
'_l3d /usr/local/bin/update-env'
NEWCOMMAND
=
'RUNNING=$(docker container ls --all -q -f name='
${
COMPOSE_PROJECT_NAME
}
'_l3d);if [ "x$RUNNING" != "x" ];then docker exec '
${
COMPOSE_PROJECT_NAME
}
'_l3d /usr/local/bin/update-env;fi'
OLD_HOOK_DEFINED
=
$(
grep
"
$OLDCOMMAND
"
.git/hooks/post-checkout
)
NEW_HOOK_DEFINED
=
$(
grep
"
$NEWCOMMAND
"
.git/hooks/post-checkout
)
if
[[
"x
$OLD_HOOK_DEFINED
"
=
"x"
]]
;
then
echo
"
$NEWCOMMAND
"
>>
.git/hooks/post-checkout
elif
[[
"x
$NEW_HOOK_DEFINED
"
=
"x"
]]
;
then
OLDCOMMAND
=
"
${
OLDCOMMAND
//\//\\/
}
"
sed
-i
-e
"/
${
OLDCOMMAND
}
/d"
.git/hooks/post-checkout
echo
"
$NEWCOMMAND
"
>>
.git/hooks/post-checkout
if
[[
"
${
COMPOSE_PROJECT_NAME
}
"
!=
"."
]]
;
then
# Setup Ahoy
setupAhoy
# Configure Git Hook
if
[[
-d
.git
]]
;
then
if
[[
!
-d
.git/hooks
]]
;
then
mkdir
-p
.git/hooks
fi
if
[[
!
-f
.git/hooks/post-checkout
]]
;
then
echo
"#!/bin/sh"
>
.git/hooks/post-checkout
chmod
+x .git/hooks/post-checkout
fi
OLDCOMMAND
=
'docker exec '
${
COMPOSE_PROJECT_NAME
}
'_l3d /usr/local/bin/update-env'
NEWCOMMAND
=
'RUNNING=$(docker container ls --all -q -f name='
${
COMPOSE_PROJECT_NAME
}
'_l3d);if [ "x$RUNNING" != "x" ];then docker exec '
${
COMPOSE_PROJECT_NAME
}
'_l3d /usr/local/bin/update-env;fi'
OLD_HOOK_DEFINED
=
$(
grep
"
$OLDCOMMAND
"
.git/hooks/post-checkout
)
NEW_HOOK_DEFINED
=
$(
grep
"
$NEWCOMMAND
"
.git/hooks/post-checkout
)
if
[[
"x
$OLD_HOOK_DEFINED
"
=
"x"
]]
;
then
echo
"
$NEWCOMMAND
"
>>
.git/hooks/post-checkout
elif
[[
"x
$NEW_HOOK_DEFINED
"
=
"x"
]]
;
then
OLDCOMMAND
=
"
${
OLDCOMMAND
//\//\\/
}
"
sed
-i
-e
"/
${
OLDCOMMAND
}
/d"
.git/hooks/post-checkout
echo
"
$NEWCOMMAND
"
>>
.git/hooks/post-checkout
fi
fi
fi
/usr/local/bin/update-env
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment