Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/remove-wordpress-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ awk '
/\/\*\* Include for ddev-browsersync to modify WP_HOME and WP_SITEURL\./ { skip=1 }
skip && /\}.*$/ { skip=0; getline; next }
!skip
' ${DDEV_SITE_PATH}/wp-config.php > ${DDEV_SITE_PATH}/wp-config-temp.php
mv ${DDEV_SITE_PATH}/wp-config-temp.php ${DDEV_SITE_PATH}/wp-config.php
' "${DDEV_SITE_PATH}/wp-config.php" > "${DDEV_SITE_PATH}/wp-config-temp.php"
mv "${DDEV_SITE_PATH}/wp-config-temp.php" "${DDEV_SITE_PATH}/wp-config.php"
8 changes: 4 additions & 4 deletions scripts/setup-wordpress-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ else
DDEV_SITE_PATH=$DDEV_APPROOT
fi

cp scripts/wp-config-ddev-browsersync.php $DDEV_SITE_PATH/
cp scripts/wp-config-ddev-browsersync.php "$DDEV_SITE_PATH/"

SETTINGS_FILE_NAME="${DDEV_SITE_PATH}/wp-config.php"

echo "Settings file name: ${SETTINGS_FILE_NAME}"

# If wp-config.php already contains the require_once() then exit early.
if grep -q "/\*\* Include for ddev-browsersync to modify WP_HOME and WP_SITEURL. \*/" ${DDEV_SITE_PATH}/wp-config.php; then
if grep -q "/\*\* Include for ddev-browsersync to modify WP_HOME and WP_SITEURL. \*/" "${DDEV_SITE_PATH}/wp-config.php"; then
exit 0
fi

Expand All @@ -43,7 +43,7 @@ awk '
next
}
{print}
' ${DDEV_SITE_PATH}/wp-config.php > ${DDEV_SITE_PATH}/wp-config-temp.php
' "${DDEV_SITE_PATH}/wp-config.php" > "${DDEV_SITE_PATH}/wp-config-temp.php"

# Replace the real config file with the modified version in temporary file.
mv ${DDEV_SITE_PATH}/wp-config-temp.php ${DDEV_SITE_PATH}/wp-config.php
mv "${DDEV_SITE_PATH}/wp-config-temp.php" "${DDEV_SITE_PATH}/wp-config.php"