Skip to content

Instantly share code, notes, and snippets.

@pwrstudio
Last active August 19, 2016 14:45
Show Gist options
  • Save pwrstudio/76ba6cf14fb6bd3ec660ce2a104154be to your computer and use it in GitHub Desktop.
Save pwrstudio/76ba6cf14fb6bd3ec660ce2a104154be to your computer and use it in GitHub Desktop.
wp.sh – wordpress setup script
#!/bin/bash
#
# Useage: wp.sh nameofproject
#
BASEDIR="/where/you/want/the/site/to/be/installed"
# $1 == first command line argument eg. 'nameofproject'
mkdir -v $BASEDIR/$1
# Start MAMP websever
open /Applications/MAMP/MAMP.app/
cd /Applications/MAMP/bin
./start.sh
# Download/configure/Install Wordpress
cd $BASEDIR/$1
wp core download
wp core config --dbname=wordpress --dbuser=root --dbpass=root --dbprefix=wp_$1_
wp core install --url=http://localhost:8888/$1 --title=$1 --admin_user=wordpress --admin_password=wordpress --admin_email=pwrpntr@gmail.com
# Clone wordpress template and activate it
git clone https://github.com/pwrstudio/pwr_wp_template.git wp-content/themes/$1
rm -rf wp-content/themes/twenty*
wp theme activate $1
# Copy standard plugins. Update all plugins.
rsync -av /where/you/keep/your/standard/plugins
wp plugin delete akismet
wp plugin delete hello
wp plugin update --all
wp plugin activate --all
# Install node dependencies and start gulp process
chmod -R a+w wp-content/
cd wp-content/themes/$1
open .
npm install
open http://localhost:3000/$1/wp-admin
gulp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment