Skip to content

Commit

Permalink
#342: Clean up / comment Drush bootstrap in drush.php to make it clea…
Browse files Browse the repository at this point in the history
…r which operations are happening in the first couple of preflight functions.
  • Loading branch information
greg-1-anderson committed Jan 23, 2015
1 parent 05c4bad commit c95ff13
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
15 changes: 6 additions & 9 deletions drush.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
* @requires PHP CLI 5.3.0, or newer.
*/

require dirname(__FILE__) . '/includes/preflight.inc';

if (drush_preflight_prepare() === FALSE) {
exit(1);
}
exit(drush_main());

/**
Expand All @@ -31,7 +26,11 @@
* Whatever the given command returns.
*/
function drush_main() {
$return = '';
// Load Drush core include files, and parse command line arguments.
require dirname(__FILE__) . '/includes/preflight.inc';
if (drush_preflight_prepare() === FALSE) {
return(1);
}
// Start code coverage collection.
if ($coverage_file = drush_get_option('drush-coverage', FALSE)) {
drush_set_context('DRUSH_CODE_COVERAGE', $coverage_file);
Expand All @@ -48,10 +47,8 @@ function drush_main() {
drush_set_context('DRUSH_BOOTSTRAP_OBJECT', $bootstrap);
$bootstrap->preflight();

// Process initial global options such as --debug.
_drush_preflight_global_options();

$return = '';
// Load the Drush configuration files.
drush_preflight();
if (!drush_get_error()) {
if ($file = drush_get_option('early', FALSE)) {
Expand Down
3 changes: 3 additions & 0 deletions includes/preflight.inc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ function drush_preflight_prepare() {

// We need some global options/arguments processed at this early stage.
drush_parse_args();

// Process initial global options such as --debug.
_drush_preflight_global_options();
}

/**
Expand Down

0 comments on commit c95ff13

Please sign in to comment.