File tree Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Original file line number Diff line number Diff line change 1- # Install wpcli
1+ # Install WP-CLI
22
33function 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}
Original file line number Diff line number Diff line change 33function 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}
You can’t perform that action at this time.
0 commit comments