Last active
April 11, 2016 14:42
-
-
Save meredevelopment/11b6d3b2ef626f72e6bb14bf26b321ca to your computer and use it in GitHub Desktop.
WP-CLI local dev installer snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Requires WP-CLI. Assumes WP-CLI is in your $PATH. | |
# Set the default LOC, TITLE, EMAIL, USER & PASSWORD as you like. | |
# Set the DB user and pass (line 11) to a user that has permissions to create DBs. | |
# run with ./installwp.sh in most cases. | |
read -p "Locale? (en_GB): " -e LOC | |
[ -z "${LOC}" ] && LOC='en_GB' | |
wp core download --locale=$LOC | |
read -p "DB Name?: " -e DBNAME | |
wp core config --dbname=$DBNAME --dbuser=[user] --dbpass=[pass] | |
wp db create | |
read -p "URL?: " -e URL | |
read -p "Title?: " -e TITLE | |
#[ -z "${TITLE}" ] && TITLE='Test Site' | |
read -p "Admin email?: " -e ADEMAIL | |
[ -z "${ADEMAIL}" ] && ADEMAIL='[email protected]' | |
read -p "Admin username?: " -e ADUSERNAME | |
[ -z "${ADUSERNAME}" ] && ADUSERNAME='defaultusername' | |
read -p "Admin password?: " -e ADPASSWORD | |
[ -z "${ADPASSWORD}" ] && ADPASSWORD='defaultpassword' | |
wp core install --url=$URL --title="$TITLE" --admin_email=$ADEMAIL --admin_user=$ADUSERNAME --admin_password=$ADPASSWORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment