Skip to content

Instantly share code, notes, and snippets.

@zytzagoo
Created August 4, 2015 13:05
Show Gist options
  • Save zytzagoo/c268b793e9dc4144daee to your computer and use it in GitHub Desktop.
Save zytzagoo/c268b793e9dc4144daee to your computer and use it in GitHub Desktop.
wp-cli quick install/setup
mkdir -p ~/bin
wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O ~/bin/wp
chmod +x ~/bin/wp
wget https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash -O ~/.wp-completion.bash
if [[ ! -s "$HOME/.bash_profile" && -s "$HOME/.profile" ]] ; then
profile_file="$HOME/.profile"
else
profile_file="$HOME/.bash_profile"
fi
if ! grep -q 'wp-completion.bash' "${profile_file}" ; then
echo "Editing ${profile_file} to source ~/.wp-completion.bash"
echo "source \"$HOME/.wp-completion.bash\"" >> "${profile_file}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment