Created
July 28, 2011 20:16
-
-
Save scottlee/1112445 to your computer and use it in GitHub Desktop.
Here's my little local development only script I use to download and install WordPress. mac, osx, mamp
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 | |
########## | |
## Setup: hardcode your mysql user/pass. Yeah, yeah, I know...it's frowned upon. | |
## but for local development, I have no problem with it. | |
## Find and replace: MYSQLUSER / MYSQLPASS | |
## | |
## Usage: This script accepts only one variable, the site name. | |
## | |
######### | |
# Create working folder | |
mkdir /tmp/getWP | |
cd /tmp/getWP | |
## Download latest (stable) version of WordPress | |
curl -O http://wordpress.org/latest.tar.gz | |
## Uncompress | |
tar -xf latest.tar.gz | |
cd /tmp/getWP/wordpress/ | |
## Edit wp-config | |
mv wp-config-sample.php wp-config.php | |
sed -i .bak "s/username_here/MYSQLUSER/g" wp-config.php | |
sed -i .bak "s/password_here/MYSQLPASS/g" wp-config.php | |
sed -i .bak "s/database_name_here/$1/g" wp-config.php | |
## Create Database | |
CMD="create database $1" | |
/Applications/MAMP/Library/bin/mysql --host=localhost -uMYSQLUSER -pMYSQLPASS -e "$CMD" | |
## Move working folder to ~/Sites | |
mv /tmp/getWP/wordpress ~/Sites/$1 | |
## Open in Firefox | |
open -a Firefox http://local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment