Skip to content

Instantly share code, notes, and snippets.

@evansolomon
Created October 8, 2012 05:54
Show Gist options
  • Save evansolomon/3850933 to your computer and use it in GitHub Desktop.
Save evansolomon/3850933 to your computer and use it in GitHub Desktop.
WordPress update script
#!/bin/bash
# Delete core directories
rm -rf wp-includes/ wp-admin/
# Delete core files in the root
ls -l | ack "^[^d]" | ack "\swp[^\s]*$" | awk '{print $9}' | xargs rm
# Recover wp-config
git checkout wp-config.php
# Update to trunk
svn export http://core.svn.wordpress.org/trunk . --force
# Add new files
git add .
# Tell git about deleted files
git status | ack deleted | awk '{print $3}' | xargs git rm
# Add a couple line breaks to separate the new git status
echo "\n\n\n"
# Print the new status
git status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment