Created
February 7, 2022 16:26
-
-
Save brichards/513ea72e9dcb29d06fc688fae876a8b0 to your computer and use it in GitHub Desktop.
A shell function to create a directory, install WordPress, configure SSL via Laravel Valet, an launch the site in Chrome
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
# Install a new WP site. | |
# Usage: wpinstall <sitename> | |
function wpinstall() { | |
# Make the directory in your local web root | |
mkdir ~/Sites/www/$@; | |
cd ~/Sites/www/$@; | |
# Download, config, and install WordPress using <sitename> for the database, URL, and site title | |
# Note: You'll need to configure your wp-cli defaults for core config and core install in a wp-cli.yml file | |
wp core download; | |
wp core config --dbname=$@; | |
wp db create; | |
wp core install --url=https://$@.test --title=$( tr '[A-Z]' '[a-z]' <<< $@ ); | |
# Configure SSL for the site with Laravel Valet | |
valet secure $@; | |
# Open the site in Chrome, | |
open -a "Google Chrome" https://$@.test/wp-admin; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment