Commit 031e614d authored by drumm's avatar drumm Committed by Neil Drumm

Use site sync API.

parent 1e29348c
...@@ -19,20 +19,17 @@ function drush_provision_drupal_pre_provision_delete($backup_file = NULL) { ...@@ -19,20 +19,17 @@ function drush_provision_drupal_pre_provision_delete($backup_file = NULL) {
function drush_provision_drupal_provision_delete() { function drush_provision_drupal_provision_delete() {
if (d()->type === 'site') { if (d()->type === 'site') {
_provision_recursive_delete(d()->root . '/sites/' . d()->uri); _provision_recursive_delete(d()->root . '/sites/' . d()->uri);
d()->service('file')->sync(d()->root . '/sites/' . d()->uri);
// we remove the aliases even if redirection is enabled as a precaution // we remove the aliases even if redirection is enabled as a precaution
// if redirection is enabled, keep silent about errors // if redirection is enabled, keep silent about errors
_provision_drupal_delete_aliases(drush_get_option('aliases', array(), 'site'), drush_get_option('redirection')); _provision_drupal_delete_aliases(drush_get_option('aliases', array(), 'site'), drush_get_option('redirection'));
} }
if (d()->type === 'platform') { elseif (d()->type === 'platform') {
if (provision_drupal_find_sites()) { if (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.')); 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 { else {
_provision_recursive_delete(d()->root); _provision_recursive_delete(d()->root);
d()->service('file')->sync(d()->root);
} }
} }
provision_drupal_sync_site();
} }
...@@ -171,6 +171,10 @@ function _provision_drupal_site_installed() { ...@@ -171,6 +171,10 @@ function _provision_drupal_site_installed() {
return FALSE; return FALSE;
} }
/**
* Sync the current Drupal platform and, if applicable, site. Call after
* finishing operations that affect the filesystem.
*/
function provision_drupal_sync_site() { function provision_drupal_sync_site() {
d()->service('file')->sync(d()->root, TRUE); d()->service('file')->sync(d()->root, TRUE);
if (d()->type === 'site') { if (d()->type === 'site') {
......
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