If I run these commands sequentially in windows CMD, I get a site up and running quite quickly.
wp core download
wp core config --dbname=my_wp_database --dbuser=root --dbpass=my-db-password
wp core install --url=http://localhost/my-site-url --title="My WP Site" --admin_user=admin --admin_password=admin [email protected]
I'd love to make this even easier with a one-click script.
My attempt is below. It "nearly" works, but there are display issues on the resulting site.
Can anyone please give me a tweaked version that works properly and allows for spaces in the site name?
create-wp-site.cmd:
@echo off
set sitename="My Lovely Site"
set dbname="my_db_name"
mkdir %sitename%
cd %sitename%
start /wait wp core download
call wp core config --dbname=%dbname% --dbuser=root --dbpass=my_db_password
call wp core install --url=http://localhost/%sitename% --title=%name% --admin_user=admin --admin_password='admin' [email protected]
PS I'm aware this question is as much about Windows batch scripting as WP development, but I imagine a script like this would be of use to many WP developers so I'm posting here.