Commit 0181a43c authored by helmo's avatar helmo Committed by helmo

Issue #2871578 by helmo: Catch relative backup name passed to provision-delete

parent 9550a23a
......@@ -6,8 +6,13 @@
function drush_provision_drupal_pre_provision_delete($backup_file = NULL) {
if (d()->type === 'site') {
drush_set_option('force', true, 'process');
drush_invoke("provision-backup", $backup_file);
drush_unset_option('force', 'process');
if (!empty($backup_file) && !strpos($backup_file, '/')) {
drush_set_error('PROVISION_DELETE_BACKUP_NAME_RELATIVE', dt('The passed backup name is a relative path, storing that in the site directory which is going to be deleted is probably not intended. Try an absolute name, or no name to let one be generated.'));
}
else {
drush_invoke("provision-backup", $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