-
Notifications
You must be signed in to change notification settings - Fork 384
/
Copy pathafter-wp-install.sh
executable file
·44 lines (37 loc) · 1.03 KB
/
after-wp-install.sh
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
#!/bin/bash
set -e
WP_VERSION=$1
INSTALL_PWA_PLUGIN=${2-false}
WP_TESTS_DIR=$3
if [[ -z $WP_VERSION ]]; then
echo "usage: $0 <wp-version> [install-pwa-plugin]"
exit 1
fi
case "$WP_VERSION" in
"4.9")
gb_version="4.9.0"
;;
"5.0" | "5.1")
gb_version="6.9.0"
;;
"5.2")
gb_version="7.6.1"
;;
*)
# WP 5.3 onwards can use the latest version of Gutenberg.
gb_version="trunk"
;;
esac
if [[ "$gb_version" != "" ]]; then
echo -n "Installing Gutenberg ${gb_version}..."
url_path=$([ $gb_version == "trunk" ] && echo "trunk" || echo "tags/${gb_version}")
gutenberg_plugin_svn_url="https://plugins.svn.wordpress.org/gutenberg/${url_path}/"
svn export -q "$gutenberg_plugin_svn_url" "$WP_CORE_DIR/src/wp-content/plugins/gutenberg"
echo "done"
fi
if [[ -n $INSTALL_PWA_PLUGIN ]]; then
echo -n "Installing PWA plugin..."
wget -O "$WP_CORE_DIR/src/wp-content/plugins/pwa.zip" https://downloads.wordpress.org/plugin/pwa.zip
unzip -d "$WP_CORE_DIR/src/wp-content/plugins/" "$WP_CORE_DIR/src/wp-content/plugins/pwa.zip"
echo "done"
fi