Commit 897577ca authored by anarcat's avatar anarcat Committed by anarcat

add a new --force flag for backups that allows disable and delete to skip error checking

Closes: #458250
parent f759d426
......@@ -51,7 +51,7 @@ function drush_provision_drupal_provision_backup($url) {
drush_log(dt("Adding sites directory to !backup_file", array('!backup_file' => $backup_file)), 'backup');
$result = provision_shell_exec("cd %s; tar -rf %s * ", drush_get_option('sites_path') . "/$url", $backup_file);
if (!$result) {
if (!$result && !drush_get_option('force', false)) {
drush_set_error('PROVISION_BACKUP_FAILED', dt("Could not back up sites directory for drupal"));
}
}
......
......@@ -10,7 +10,9 @@ function drush_provision_drupal_provision_delete_validate($url = NULL, $backup_f
* Before starting to delete the site, make a backup
*/
function drush_provision_drupal_pre_provision_delete($url, $backup_file = NULL) {
drush_invoke('provision backup', $url, $backup_file);
drush_set_option('force', true, 'process');
drush_invoke("provision backup", $url, $backup_file);
drush_unset_option('force', 'process');
}
/**
......
......@@ -23,7 +23,9 @@ function drush_provision_drupal_provision_disable_validate() {
* Make a backup of the site before we mess with it
*/
function drush_provision_drupal_pre_provision_disable($url, $backup_file = null) {
drush_get_option('force', true, 'process');
drush_invoke("provision backup", $url, $backup_file);
drush_unset_option('force', 'process');
}
/**
......
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