Skip to content

Instantly share code, notes, and snippets.

@ajaegers
Last active August 29, 2015 14:20
Show Gist options
  • Save ajaegers/d4c5286e52581821cb43 to your computer and use it in GitHub Desktop.
Save ajaegers/d4c5286e52581821cb43 to your computer and use it in GitHub Desktop.
One command to install WP-CLI on hosting using alias (if you cannot move wp-cli.phar in PATH)
echo '1. Downloading WP-CLI in ~/bin/...' \
&& cd ~ && mkdir bin && cd bin \
&& curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x wp-cli.phar \
&& echo '2. WP-CLI test...' \
&& php wp-cli.phar --info \
&& echo '3. Making wp alias...' \
&& echo "alias wp='php ~/bin/wp-cli.phar'" >> ~/.bash_aliases \
&& source ~/.bash_aliases \
&& echo '4. Making bash wp alias to be available on each login...' \
&& echo -e "if [ -f ~/.bash_aliases ]; then\n. ~/.bash_aliases\nfi" >> ~/.bash_profile \
&& echo '5. Finished :)'\
&& cd ~ && pwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment