Skip to content

Commit a4fa25d

Browse files
committed
Change wp-cli installation way #289
1 parent 65cd4ab commit a4fa25d

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

src/vendor/ee_ven_install_wpcli.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
# Install wpcli
1+
# Install WP-CLI
22

33
function ee_ven_install_wpcli()
44
{
5-
if [ ! -d /usr/share/wp-cli ]; then
5+
if [ ! -f /usr/local/bin/wp ]; then
6+
ee_lib_echo "Downloading WP-CLI, please wait..."
7+
wget -qO /usr/local/bin/wp https://github.com/wp-cli/wp-cli/releases/download/v${EE_WP_CLI_VERSION}/wp-cli.phar \
8+
|| ee_lib_error "Unable to download WP-CLI, exit status = " $?
69

7-
ee_lib_echo "Installing WP-CLI, please wait..."
8-
curl -sL https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh \
9-
| INSTALL_DIR='/usr/share/wp-cli' VERSION=$EE_WP_CLI_VERSION bash &>> $EE_COMMAND_LOG \
10-
|| ee_lib_error "Unable to install WP-CLI, exit status = " $?
10+
# Executable permission
11+
chmod a+x /usr/local/bin/wp
1112

12-
# Add WP-CLI command in $PATH variable
13-
if [ ! -L /usr/bin/wp ]; then
14-
ln -s /usr/share/wp-cli/bin/wp /usr/bin/wp \
15-
|| ee_lib_error "Unable to create symbolic link for WP-CLI command, exit status = " $?
16-
fi
17-
18-
# Auto completion for WP-CLI
19-
cp /usr/share/wp-cli/vendor/wp-cli/wp-cli/utils/wp-completion.bash /etc/bash_completion.d/
20-
source /etc/bash_completion.d/wp-completion.bash
13+
# Download auto completion
14+
wget -qO /etc/bash_completion.d/wp-completion.bash https://raw.githubusercontent.com/wp-cli/wp-cli/v0.16.0/utils/wp-completion.bash
2115
fi
2216
}

src/vendor/ee_ven_remove_wpcli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
function ee_ven_remove_wpcli()
44
{
55
ee_lib_echo "Removing WP-CLI, please wait..."
6-
rm -rf /usr/share/wp-cli /usr/bin/wp /etc/bash_completion.d/wp-completion.bash \
6+
rm -rf /usr/local/bin/wp /etc/bash_completion.d/wp-completion.bash \
77
|| ee_lib_error "Unable to remove WP-CLI, exit status = " $?
88
}

0 commit comments

Comments
 (0)