Skip to content

Instantly share code, notes, and snippets.

@joncutrer
Created June 2, 2020 16:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joncutrer/a5baf1fafb1fe2f1c406bb1aedf99834 to your computer and use it in GitHub Desktop.
Save joncutrer/a5baf1fafb1fe2f1c406bb1aedf99834 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Install WordPress CLI
# Must be run as root for permission to write to /usr/local/bin
#
dl_url=https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
tmp_dir=$(mktemp -d -t wpcli-XXXXXXXXXX)
curl -o $tmp_dir/wp-cli.phar $dl_url
chmod +x $tmp_dir/wp-cli.phar
mv $tmp_dir/wp-cli.phar /usr/local/bin/wp
rm -rf $tmp_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment