Mitesh Shah
11 years ago
2 changed files with 10 additions and 16 deletions
@ -1,22 +1,16 @@ |
|||||
# Install wpcli |
# Install WP-CLI |
||||
|
|
||||
function ee_ven_install_wpcli() |
function ee_ven_install_wpcli() |
||||
{ |
{ |
||||
if [ ! -d /usr/share/wp-cli ]; then |
if [ ! -f /usr/local/bin/wp ]; then |
||||
|
ee_lib_echo "Downloading WP-CLI, please wait..." |
||||
|
wget -qO /usr/local/bin/wp https://github.com/wp-cli/wp-cli/releases/download/v${EE_WP_CLI_VERSION}/wp-cli.phar \ |
||||
|
|| ee_lib_error "Unable to download WP-CLI, exit status = " $? |
||||
|
|
||||
ee_lib_echo "Installing WP-CLI, please wait..." |
# Executable permission |
||||
curl -sL https://raw.github.com/wp-cli/wp-cli.github.com/master/installer.sh \ |
chmod a+x /usr/local/bin/wp |
||||
| INSTALL_DIR='/usr/share/wp-cli' VERSION=$EE_WP_CLI_VERSION bash &>> $EE_COMMAND_LOG \ |
|
||||
|| ee_lib_error "Unable to install WP-CLI, exit status = " $? |
|
||||
|
|
||||
# Add WP-CLI command in $PATH variable |
# Download auto completion |
||||
if [ ! -L /usr/bin/wp ]; then |
wget -qO /etc/bash_completion.d/wp-completion.bash https://raw.githubusercontent.com/wp-cli/wp-cli/v0.16.0/utils/wp-completion.bash |
||||
ln -s /usr/share/wp-cli/bin/wp /usr/bin/wp \ |
|
||||
|| ee_lib_error "Unable to create symbolic link for WP-CLI command, exit status = " $? |
|
||||
fi |
|
||||
|
|
||||
# Auto completion for WP-CLI |
|
||||
cp /usr/share/wp-cli/vendor/wp-cli/wp-cli/utils/wp-completion.bash /etc/bash_completion.d/ |
|
||||
source /etc/bash_completion.d/wp-completion.bash |
|
||||
fi |
fi |
||||
} |
} |
||||
|
Loading…
Reference in new issue