-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from youwe-petervanderwal/feat/git-hook-via-ddev
feat: execute Git hook within DDev
- Loading branch information
Showing
5 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
if [ -z "${IS_DDEV_PROJECT-}" ] \ | ||
&& [ -z "${YOUWE_BYPASS_DDEV-}" ] \ | ||
&& [ -f .ddev/config.yaml ] \ | ||
&& which ddev >/dev/null | ||
then | ||
# - We're not already running within DDev (in that case $IS_DDEV_PROJECT equals true) | ||
# - The YOUWE_BYPASS_DDEV flag isn't set by the user | ||
# - We found the .ddev/config.yaml file, indicating this project runs in DDev | ||
# - We found the DDev binary, indicating we're not on a build server | ||
ddev exec "$@" | ||
exit $? | ||
fi | ||
|
||
exec "$@" | ||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters