Skip to content

Instantly share code, notes, and snippets.

@robballou
Created January 21, 2016 15:29
Show Gist options
  • Save robballou/6a96d1a4c3222ed3acd3 to your computer and use it in GitHub Desktop.
Save robballou/6a96d1a4c3222ed3acd3 to your computer and use it in GitHub Desktop.
Some functions for shells and drush
# drestore()
#
# Restore a drush database backup:
#
# drestore [backup]
function drestore() {
drush sql-drop --yes
pv $1 | drush sqlc
if [[ -e ./core ]]; then
drush cache-rebuild
return
fi
drush registry-rebuild
}
# dren()
#
# drush re-enable
function dren() {
# drupal 8
if [[ -e ./core ]]; then
drush pm-uninstall --yes $1 && drush pm-enable --yes $1
return
fi
drush pm-disable --yes $1 && drush pm-enable --yes $1
}
# dun()
#
# drush uninstall
function dun() {
# drupal 8
if [[ -e ./core ]]; then
drush pm-uninstall --yes
return
fi
drush pm-disable --yes $1 && drush pm-uninstall --yes $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment