Skip to content

Instantly share code, notes, and snippets.

@c31ck
Created February 27, 2014 13:08
Show Gist options
  • Save c31ck/9249698 to your computer and use it in GitHub Desktop.
Save c31ck/9249698 to your computer and use it in GitHub Desktop.
Drush policy.
<?php
/**
* @file
* Drush policy.
*/
/**
* Implements drush_hook_COMMAND_validate().
*/
function drush_policy_sql_sync_validate($source = NULL, $destination = NULL) {
if (strpos( $destination, 'prod') !== FALSE) {
return drush_set_error(dt('Blocked by drush policy: dont overwrite the production DB.'));
}
}
/**
* Implements drush_hook_COMMAND_validate().
*/
function drush_policy_rsync_validate($source = NULL, $destination = NULL) {
if (strpos($destination, 'prod') !== FALSE) {
return drush_set_error(dt('Blocked by drush policy: dont overwrite the production files.'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment