-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#7 Add script to update grumphp.yml to add DDEV support.
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Script to update the grumphp.yml file to use both Lando and DDEV on GIT commit. | ||
# | ||
# It's run on composer install, only if grumphp.yml exists and if it contains: | ||
# EXEC_GRUMPHP_COMMAND: lando php | ||
# This is the previous default we've used. | ||
# | ||
|
||
# Path to the grumphp.yml file | ||
config_file="grumphp.yml" | ||
|
||
if [ -f "grumphp.yml" ]; then | ||
sed -i "s#EXEC_GRUMPHP_COMMAND: lando php#EXEC_GRUMPHP_COMMAND: \"[ -d .ddev/traefik/ ] \&\& GRUMPHP_COMMAND='ddev php' || GRUMPHP_COMMAND='lando php' \&\& \$GRUMPHP_COMMAND\"#g" grumphp.yml | ||
|
||
# Did sed replace? | ||
if [ $? -eq 0 ]; then | ||
# Add a message to the user. | ||
color_red="\033[0;31m" | ||
color_reset="\033[0m" | ||
printf "${color_red}Added DDEV support to $config_file.\n" | ||
echo "Please run \"ddev grumphp git:init\" for the changes to take affect." | ||
printf "${color_reset}" | ||
fi | ||
|
||
|
||
fi |
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