Skip to content

Commit dfce759

Browse files
fix: quote $DDEV_SITE_PATH to handle paths with spaces, fixes #85 (#86)
1 parent 9785e32 commit dfce759

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

scripts/remove-wordpress-settings.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ awk '
2626
/\/\*\* Include for ddev-browsersync to modify WP_HOME and WP_SITEURL\./ { skip=1 }
2727
skip && /\}.*$/ { skip=0; getline; next }
2828
!skip
29-
' ${DDEV_SITE_PATH}/wp-config.php > ${DDEV_SITE_PATH}/wp-config-temp.php
30-
mv ${DDEV_SITE_PATH}/wp-config-temp.php ${DDEV_SITE_PATH}/wp-config.php
29+
' "${DDEV_SITE_PATH}/wp-config.php" > "${DDEV_SITE_PATH}/wp-config-temp.php"
30+
mv "${DDEV_SITE_PATH}/wp-config-temp.php" "${DDEV_SITE_PATH}/wp-config.php"

scripts/setup-wordpress-settings.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ else
1717
DDEV_SITE_PATH=$DDEV_APPROOT
1818
fi
1919

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

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

2424
echo "Settings file name: ${SETTINGS_FILE_NAME}"
2525

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

@@ -43,7 +43,7 @@ awk '
4343
next
4444
}
4545
{print}
46-
' ${DDEV_SITE_PATH}/wp-config.php > ${DDEV_SITE_PATH}/wp-config-temp.php
46+
' "${DDEV_SITE_PATH}/wp-config.php" > "${DDEV_SITE_PATH}/wp-config-temp.php"
4747

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

0 commit comments

Comments
 (0)