Last active
August 29, 2015 14:25
-
-
Save andrewwoods/013e5f09e73d1345c9a9 to your computer and use it in GitHub Desktop.
Install and Configure WordPress using WP-CLI
This file contains 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
# | |
# wp_install - download wordpress, install, and configure it. | |
# | |
# $ wp_install <dirname> | |
# | |
function wp_install | |
{ | |
wp core download --path=$1 | |
cd $1 | |
read -p 'name the database:' dbname | |
wp core config --dbname=$dbname --dbuser=root --dbpass=awoods --dbhost=localhost | |
wp db create | |
wp core install --prompt | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of using --prompt on wp core config, it's better UX to hard code the value for --dbuser --dbpass and --dbhost and just use bash to prompt for the --dbname. There are 11 prompts for wp core config! you shouldn't have to answer them every time.
A compromise would be to create bash prompts for the --dbname --dbpass and --dbhost.