Commit d38fb98a authored by anarcat's avatar anarcat

1074932 by EugenMayer: add --force option to provision-delete platforms with zombie sites in

parent 334afd12
......@@ -5,8 +5,7 @@ function drush_http_provision_delete() {
d()->service('http')->delete_config('site');
}
if (d()->type === 'platform') {
$sites = provision_drupal_find_sites();
if($sites) {
if (!drush_get_option('force', FALSE) && drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_ROOT) && provision_drupal_find_sites()) {
drush_set_error(dt('Existing sites were found on this platform. These sites will need to be deleted before this platform can be deleted.'));
}
else {
......
......@@ -18,6 +18,7 @@ function drush_provision_drupal_pre_provision_delete($backup_file = NULL) {
*/
function drush_provision_drupal_provision_delete() {
if (d()->type === 'site') {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_ROOT);
_provision_recursive_delete(d()->site_path);
// we remove the aliases even if redirection is enabled as a precaution
// if redirection is enabled, keep silent about errors
......@@ -26,7 +27,7 @@ function drush_provision_drupal_provision_delete() {
provision_drupal_sync_site();
}
elseif (d()->type === 'platform') {
if (provision_drupal_find_sites()) {
if (!drush_get_option('force', FALSE) && drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_ROOT) && provision_drupal_find_sites()) {
drush_set_error(dt('Existing sites were found on this platform. These sites will need to be deleted before this platform can be deleted.'));
}
else {
......
......@@ -162,7 +162,7 @@ function provision_drush_command() {
$items['provision-delete'] = array(
'description' => 'Delete a site.',
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
'bootstrap' => DRUSH_BOOTSTRAP_DRUSH
);
$items['provision-login_reset'] = array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment