Skip to content

Instantly share code, notes, and snippets.

@mpdonadio
Created January 17, 2015 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpdonadio/759db13c4c4a9c17b754 to your computer and use it in GitHub Desktop.
Save mpdonadio/759db13c4c4a9c17b754 to your computer and use it in GitHub Desktop.
drupal-clean()
function drupal-clean() {
# Remove existing database
drush sql-drop -y;
# Remove existing install
sudo rm -rf sites/default;
# Restore the sites/default/default.settings.php file
sudo git checkout -- sites/default;
# Temporarily make the sites/default writable by anyone
sudo chmod -R 777 sites/default;
# Ensure the owner is the current user, not root user
sudo chown -R `whoami` sites/default;
# Now that we own it and can write, change the permissions back to how drupal expects them
sudo git checkout -- sites/default;
# But still ensure that we own the folder
sudo chown -R `whoami` sites/default;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment