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,6 +48,9 @@ function provision_drupal_drush_engine_drupal() { ...@@ -48,6 +48,9 @@ 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) { if ($url) {
drush_set_option('uri' , 'http://' . $url); drush_set_option('uri' , 'http://' . $url);
...@@ -60,6 +63,7 @@ function provision_drupal_drush_init($url = NULL) { ...@@ -60,6 +63,7 @@ function provision_drupal_drush_init($url = NULL) {
define('PROVISION_CONTEXT_SITE', ($url) ? TRUE : FALSE); define('PROVISION_CONTEXT_SITE', ($url) ? TRUE : FALSE);
define('PROVISION_CONTEXT_PLATFORM', !PROVISION_CONTEXT_SITE); define('PROVISION_CONTEXT_PLATFORM', !PROVISION_CONTEXT_SITE);
}
} }
/** /**
...@@ -70,7 +74,9 @@ function provision_drupal_drush_init($url = NULL) { ...@@ -70,7 +74,9 @@ 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();
$command = explode(" ", $command['command']);
if ($command[0] == 'provision') {
if (PROVISION_CONTEXT_SITE) { if (PROVISION_CONTEXT_SITE) {
if (drush_get_option('installed')) { if (drush_get_option('installed')) {
drush_set_option('site_url', drush_get_option('site_url'), 'site'); drush_set_option('site_url', drush_get_option('site_url'), 'site');
...@@ -81,6 +87,7 @@ function provision_drupal_drush_exit($url = NULL) { ...@@ -81,6 +87,7 @@ function provision_drupal_drush_exit($url = NULL) {
else { else {
_provision_generate_config(); _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