Skip to content

Instantly share code, notes, and snippets.

@greg-1-anderson
Last active August 29, 2015 14:19
Show Gist options
  • Save greg-1-anderson/56d640c4c6c067b479d0 to your computer and use it in GitHub Desktop.
Save greg-1-anderson/56d640c4c6c067b479d0 to your computer and use it in GitHub Desktop.
Convert 'drush cc all' into 'drush cache-rebuild' on Drupal 8 sites.
<?php
// Put this in ~/.drush/policy.drush.inc
function policy_drush_command_alter(&$command) {
if (($command['command'] == 'cache-clear') && (drush_drupal_major_version() >= 8)) {
$command['command'] = 'cache-rebuild';
$command['command-hook'] = 'cache-rebuild';
$command['primary function'] = FALSE;
$command['arguments'] = array();
drush_set_command($command);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment