Commit 966c7493 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

Only do provision init stuff when the command is provision something

parent bf2e5a65
...@@ -48,18 +48,22 @@ function provision_drupal_drush_engine_drupal() { ...@@ -48,18 +48,22 @@ function provision_drupal_drush_engine_drupal() {
* for populating the $data context array * for populating the $data context array
*/ */
function provision_drupal_drush_init($url = NULL) { function provision_drupal_drush_init($url = NULL) {
$command = drush_get_command();
$command = explode(" ", $command['command']);
if ($command[0] == 'provision') {
if ($url) {
drush_set_option('uri' , 'http://' . $url);
provision_load_site_data($url);
drush_set_default('site_url', $url);
drush_set_default('profile', 'default');
drush_set_default('language', 'en');
drush_set_default('aliases', array());
}
if ($url) { define('PROVISION_CONTEXT_SITE', ($url) ? TRUE : FALSE);
drush_set_option('uri' , 'http://' . $url); define('PROVISION_CONTEXT_PLATFORM', !PROVISION_CONTEXT_SITE);
provision_load_site_data($url);
drush_set_default('site_url', $url);
drush_set_default('profile', 'default');
drush_set_default('language', 'en');
drush_set_default('aliases', array());
} }
define('PROVISION_CONTEXT_SITE', ($url) ? TRUE : FALSE);
define('PROVISION_CONTEXT_PLATFORM', !PROVISION_CONTEXT_SITE);
} }
/** /**
...@@ -70,16 +74,19 @@ function provision_drupal_drush_init($url = NULL) { ...@@ -70,16 +74,19 @@ function provision_drupal_drush_init($url = NULL) {
* files for future runs. * files for future runs.
*/ */
function provision_drupal_drush_exit($url = NULL) { function provision_drupal_drush_exit($url = NULL) {
$command = drush_get_command();
if (PROVISION_CONTEXT_SITE) { $command = explode(" ", $command['command']);
if (drush_get_option('installed')) { if ($command[0] == 'provision') {
drush_set_option('site_url', drush_get_option('site_url'), 'site'); if (PROVISION_CONTEXT_SITE) {
drush_set_option('site_id', drush_get_option('site_id'), 'site'); if (drush_get_option('installed')) {
provision_save_site_data($url); drush_set_option('site_url', drush_get_option('site_url'), 'site');
drush_set_option('site_id', drush_get_option('site_id'), 'site');
provision_save_site_data($url);
}
}
else {
_provision_generate_config();
} }
}
else {
_provision_generate_config();
} }
} }
......
...@@ -6,7 +6,7 @@ function provision_drupal_provision_update_validate() { ...@@ -6,7 +6,7 @@ function provision_drupal_provision_update_validate() {
function provision_drupal_provision_update($url) { function provision_drupal_provision_update($url) {
_provision_drupal_create_settings_file($url); _provision_drupal_create_settings_file($url);
drush_backend_invoke("update", array('uri' => "http://$url")); drush_backend_invoke("updatedb", array('uri' => "http://$url"));
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE); drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
# drush_include_engine('drupal', 'update'); # drush_include_engine('drupal', 'update');
# drush_include_engine('drupal', 'clear'); # drush_include_engine('drupal', 'clear');
......
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