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
Tags
feature104a
Tags containing commit
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 {
...
@@ -27,6 +27,9 @@ function truncateCurrentDirectory {
}
}
function
restoreEnvFile
{
function
restoreEnvFile
{
if
[[
"
${
COMPOSE_PROJECT_NAME
}
"
==
"."
]]
;
then
return
fi
if
[[
-n
${
PHP_VERSION
}
]]
;
then
if
[[
-n
${
PHP_VERSION
}
]]
;
then
echo
"PHP_VERSION=
${
PHP_VERSION
}
"
>>
.env
echo
"PHP_VERSION=
${
PHP_VERSION
}
"
>>
.env
fi
fi
...
@@ -235,31 +238,34 @@ else
...
@@ -235,31 +238,34 @@ else
l3dComposer
l3dComposer
fi
fi
setupAhoy
if
[[
-d
/drupal/.idea
]]
;
then
if
[[
-d
/drupal/.idea
]]
;
then
/usr/local/bin/.configIdea
/usr/local/bin/.configIdea
fi
fi
restoreEnvFile
restoreEnvFile
# Configure Git Hook
if
[[
"
${
COMPOSE_PROJECT_NAME
}
"
!=
"."
]]
;
then
if
[[
-d
.git
]]
;
then
# Setup Ahoy
if
[[
!
-d
.git/hooks
]]
;
then
setupAhoy
mkdir
-p
.git/hooks
# Configure Git Hook
fi
if
[[
-d
.git
]]
;
then
if
[[
!
-f
.git/hooks/post-checkout
]]
;
then
if
[[
!
-d
.git/hooks
]]
;
then
echo
"#!/bin/sh"
>
.git/hooks/post-checkout
mkdir
-p
.git/hooks
chmod
+x .git/hooks/post-checkout
fi
fi
if
[[
!
-f
.git/hooks/post-checkout
]]
;
then
OLDCOMMAND
=
'docker exec '
${
COMPOSE_PROJECT_NAME
}
'_l3d /usr/local/bin/update-env'
echo
"#!/bin/sh"
>
.git/hooks/post-checkout
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'
chmod
+x .git/hooks/post-checkout
OLD_HOOK_DEFINED
=
$(
grep
"
$OLDCOMMAND
"
.git/hooks/post-checkout
)
fi
NEW_HOOK_DEFINED
=
$(
grep
"
$NEWCOMMAND
"
.git/hooks/post-checkout
)
OLDCOMMAND
=
'docker exec '
${
COMPOSE_PROJECT_NAME
}
'_l3d /usr/local/bin/update-env'
if
[[
"x
$OLD_HOOK_DEFINED
"
=
"x"
]]
;
then
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'
echo
"
$NEWCOMMAND
"
>>
.git/hooks/post-checkout
OLD_HOOK_DEFINED
=
$(
grep
"
$OLDCOMMAND
"
.git/hooks/post-checkout
)
elif
[[
"x
$NEW_HOOK_DEFINED
"
=
"x"
]]
;
then
NEW_HOOK_DEFINED
=
$(
grep
"
$NEWCOMMAND
"
.git/hooks/post-checkout
)
OLDCOMMAND
=
"
${
OLDCOMMAND
//\//\\/
}
"
if
[[
"x
$OLD_HOOK_DEFINED
"
=
"x"
]]
;
then
sed
-i
-e
"/
${
OLDCOMMAND
}
/d"
.git/hooks/post-checkout
echo
"
$NEWCOMMAND
"
>>
.git/hooks/post-checkout
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
fi
fi
/usr/local/bin/update-env
/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