forked from ddev/ddev-browsersync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.yaml
More file actions
61 lines (56 loc) · 2.18 KB
/
install.yaml
File metadata and controls
61 lines (56 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: ddev-browsersync
project_files:
- config.browsersync.yaml
- web-build/Dockerfile.ddev-browsersync
- browser-sync.cjs
- commands/web/browsersync
- scripts/wp-config-ddev-browsersync.php
- scripts/remove-wordpress-settings.sh
- scripts/setup-wordpress-settings.sh
ddev_version_constraint: '>= v1.24.3'
post_install_actions:
- |
#ddev-nodisplay
#ddev-description:Check for global browsersync
if test -f "$HOME/.ddev/commands/web/browsersync"; then
echo "Note: '~/.ddev/commands/web/browsersync' is no longer required and can be safely removed." && exit 0
fi
- |
#ddev-nodisplay
#ddev-description:Check for 'browser-sync.js'
if test -f "$DDEV_APPROOT/commands/web/browsersync.js"; then
echo "Note: '$DDEV_APPROOT/commands/web/browsersync.js' is no longer required and can be safely removed." && exit 0
fi
- |
#ddev-nodisplay
#ddev-description:Remove old 'docker-compose.browsersync.yaml'
if grep "#ddev-generated" $DDEV_APPROOT/.ddev/docker-compose.browsersync.yaml 2>/dev/null; then
rm -f "$DDEV_APPROOT/.ddev/docker-compose.browsersync.yaml"
fi
- |
#ddev-nodisplay
#ddev-description:Install browsersync settings for WordPress if applicable
scripts/setup-wordpress-settings.sh
- |
#ddev-nodisplay
#ddev-description:Check for WordPress and disable ddev management of wp-config file
if [[ $DDEV_PROJECT_TYPE = 'wordpress' ]]; then
ddev config --disable-settings-management=true;
fi
removal_actions:
- |
#ddev-nodisplay
#ddev-description:Remove browsersync settings for WordPress if applicable
if [ "$DDEV_DOCROOT" != "" ]; then
DDEV_SITE_PATH="${DDEV_APPROOT}/${DDEV_DOCROOT}" ;
else
DDEV_SITE_PATH=$DDEV_APPROOT
fi
rm -f "${DDEV_SITE_PATH}/wp-config-ddev-browsersync.php"
scripts/remove-wordpress-settings.sh
# Don't automatically renable settings management in case user didn't have it enabled in the first place
- |
if [ "$DDEV_PROJECT_TYPE" = "wordpress" ]; then
echo "Note: You may wish to renable ddev's management of the wp-config file:"
echo " Run 'ddev config --disable-settings-management=false && ddev restart'"
fi