Last active
August 29, 2015 14:10
-
-
Save gabesullice/273538fda7b4258c2a49 to your computer and use it in GitHub Desktop.
Sunpower Reset Function
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
sunrst () { | |
if [[ $# < 2 ]]; then | |
echo "You must specify at least an alias and a multisite directory name." | |
fi | |
read -p "Would you like to run updates (y/n)? " UPDB | |
alias=$1 | |
site=$2 | |
cd <path to your sunpower root>/docroot/sites/$site | |
drush use $site | |
drush sql-drop -y | |
drush sql-sync -y --no-cache $alias $site | |
drush en -y devel ${@:3} | |
drush vset --yes preprocess_css 0 | |
if [ "$UPDB" == "y" ]; then | |
drush updb -y | |
fi | |
drush cc all | |
} |
Don't forget to edit <path to your sunpower root>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This adds a simple function to get the latest db when added to your .bashrc/.bash_profile.
The command takes >= 2 arguments. The first is the alias of the site you want to sync from. The second is the multisite directory to be used. you can specify any number of modules after that to be enabled after sync.
e.g.
This will sync the international production db to your international local install, then it will enable devel (enabled by default in the script), stage_file_proxy, and views_ui.