Last active
September 25, 2018 16:35
-
-
Save aapis/f06e7381b7b1770757acdad81d50dd90 to your computer and use it in GitHub Desktop.
Setup a whole new Wordpress site quickly so you can start themeing
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
initproject(){ | |
: ${1?Domain argument required} | |
PROJECT_NAME=$1 | |
CWD=`pwd` | |
echo "Creating project at $CWD/$PROJECT_NAME..." | |
mkdir $PROJECT_NAME && cd $PROJECT_NAME | |
echo "Downloading Wordpress..." | |
wget --quiet http://wordpress.org/latest.zip --no-check-certificate | |
echo "Download complete, unzipping..." | |
unzip -qq latest.zip | |
echo "Moving files..." | |
mv wordpress/* . | |
echo "Cleaning up..." | |
rm -rf wordpress/ | |
rm -f latest.zip | |
# setup git | |
echo "Performing git setup..." | |
cd "$CWD/$PROJECT_NAME/wp-content/themes" && mkdir $PROJECT_NAME | |
cd $PROJECT_NAME | |
# pull starter theme repo | |
git clone git@github.com:Automattic/_s.git . | |
# remove starter theme git repo so we can add our own | |
rm -rf .git | |
git init . | |
git add . > /dev/null | |
git commit --quiet --no-status -am "Initial commit for project $PROJECT_NAME" | |
echo "Removing default themes..." | |
cd .. && rm -rf twenty* | |
echo "All tasks complete!" | |
cd "$CWD/$PROJECT_NAME/wp-content/themes/$PROJECT_NAME" | |
} | |
initemptyproject(){ | |
: ${1?Domain argument required} | |
PROJECT_NAME=$1 | |
CWD=`pwd` | |
echo "Creating project at $CWD/$PROJECT_NAME..." | |
mkdir $PROJECT_NAME && cd $PROJECT_NAME | |
echo "Downloading Wordpress..." | |
wget --quiet http://wordpress.org/latest.zip --no-check-certificate | |
echo "Download complete, unzipping..." | |
unzip -qq latest.zip | |
echo "Moving files..." | |
mv wordpress/* . | |
echo "Cleaning up..." | |
rm -rf wordpress/ | |
rm -f latest.zip | |
# setup git | |
echo "Performing git setup..." | |
cd "$CWD/$PROJECT_NAME/wp-content/themes" && mkdir $PROJECT_NAME | |
cd $PROJECT_NAME | |
git init . | |
echo "All tasks complete!" | |
cd "$CWD/$PROJECT_NAME/wp-content/themes/$PROJECT_NAME" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment