File tree Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,12 @@ removal_actions:
46
46
- |
47
47
#ddev-nodisplay
48
48
#ddev-description:Remove browsersync settings for WordPress if applicable
49
- rm -f "${DDEV_APPROOT}/wp-config-ddev-browsersync.php"
49
+ if [ $DDEV_DOCROOT != "" ]; then
50
+ DDEV_SITE_PATH="${DDEV_APPROOT}/${DDEV_DOCROOT}" ;
51
+ else
52
+ DDEV_SITE_PATH=$DDEV_APPROOT
53
+ fi
54
+ rm -f "${DDEV_SITE_PATH}/wp-config-ddev-browsersync.php"
50
55
scripts/remove-wordpress-settings.sh
51
56
# Don't automatically renable settings management in case user didn't have it enabled in the first place
52
57
- |
Original file line number Diff line number Diff line change 11
11
# exit 0
12
12
# fi
13
13
14
- SETTINGS_FILE_NAME=" ${DDEV_APPROOT} /wp-config.php"
14
+ if [ $DDEV_DOCROOT != " " ]; then
15
+ DDEV_SITE_PATH=" ${DDEV_APPROOT} /${DDEV_DOCROOT} " ;
16
+ else
17
+ DDEV_SITE_PATH=$DDEV_APPROOT
18
+ fi
19
+
20
+ SETTINGS_FILE_NAME=" ${DDEV_SITE_PATH} /wp-config.php"
15
21
16
22
echo " Removing wp-config-ddev-browsersync.php from: ${SETTINGS_FILE_NAME} "
17
23
20
26
/\/\*\* Include for ddev-browsersync to modify WP_HOME and WP_SITEURL\./ { skip=1 }
21
27
skip && /\}.*$/ { skip=0; getline; next }
22
28
!skip
23
- ' ${DDEV_APPROOT } /wp-config.php > ${DDEV_APPROOT } /wp-config-temp.php
24
- mv ${DDEV_APPROOT } /wp-config-temp.php ${DDEV_APPROOT } /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
Original file line number Diff line number Diff line change 11
11
# exit 0
12
12
# fi
13
13
14
- cp scripts/wp-config-ddev-browsersync.php $DDEV_APPROOT /
14
+ if [ $DDEV_DOCROOT != " " ]; then
15
+ DDEV_SITE_PATH=" ${DDEV_APPROOT} /${DDEV_DOCROOT} " ;
16
+ else
17
+ DDEV_SITE_PATH=$DDEV_APPROOT
18
+ fi
19
+
20
+ cp scripts/wp-config-ddev-browsersync.php $DDEV_SITE_PATH /
15
21
16
- SETTINGS_FILE_NAME=" ${DDEV_APPROOT } /wp-config.php"
22
+ SETTINGS_FILE_NAME=" ${DDEV_SITE_PATH } /wp-config.php"
17
23
18
24
echo " Settings file name: ${SETTINGS_FILE_NAME} "
19
25
20
26
# If wp-config.php already contains the require_once() then exit early.
21
- if grep -q " /\*\* Include for ddev-browsersync to modify WP_HOME and WP_SITEURL. \*/" ${DDEV_APPROOT } /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
22
28
exit 0
23
29
fi
24
30
37
43
next
38
44
}
39
45
{print}
40
- ' ${DDEV_APPROOT } /wp-config.php > ${DDEV_APPROOT } /wp-config-temp.php
46
+ ' ${DDEV_SITE_PATH } /wp-config.php > ${DDEV_SITE_PATH } /wp-config-temp.php
41
47
42
48
# Replace the real config file with the modified version in temporary file.
43
- mv ${DDEV_APPROOT } /wp-config-temp.php ${DDEV_APPROOT } /wp-config.php
49
+ mv ${DDEV_SITE_PATH } /wp-config-temp.php ${DDEV_SITE_PATH } /wp-config.php
You can’t perform that action at this time.
0 commit comments