diff --git a/commands/core/core.drush.inc b/commands/core/core.drush.inc index a49b837..0f6e33b 100644 --- a/commands/core/core.drush.inc +++ b/commands/core/core.drush.inc @@ -305,6 +305,7 @@ function core_drush_command() { 'drush qd --profile=minimal --dev --cache --core=drupal-8.x --yes' => 'Fire up dev release of Drupal site with minimal install profile.', 'drush qd testsite devel --server=:8081/admin --browser=firefox --cache --yes' => 'Fire up stable release (using the cache) of Drupal site called "testsite", download and enable devel module, start a server on port 8081 and open /admin in firefox.', 'drush qd commercesite --core=commerce_kickstart --profile=commerce_kickstart --cache --yes --watchdog' => 'Download and install the "Commerce Kickstart" distribution/install profile, display watchdog messages on the server console.', + 'drush qd --makefile=mysite.make' => 'Create and install a site from a makefile.', ), ); // Add in options/engines. @@ -813,7 +814,19 @@ function drush_core_quick_drupal() { $args = func_get_args(); $name = drush_get_option('use-name'); drush_set_option('backend', TRUE); - if (drush_get_option('use-existing', FALSE)) { + $makefile = drush_get_option('makefile'); + if (!empty($makefile)) { + $root = drush_get_option(array('root', 'r'), getcwd() . '/' . basename(basename($makefile, '.bootstrap'), '.make') . '-drupal'); + // Invoke 'drush make $makefile'. + $result = drush_invoke_process(array('root' => '', 'uri' => ''), 'make', array($makefile, $root), array('debug' => TRUE)); + if ($result['error_status'] != 0) { + return drush_set_error('DRUSH_QD_MAKE', 'Could not make; aborting.'); + } + drush_set_option('root', $root); + drush_set_option('use-existing', TRUE); + $base = dirname($root); + } + else if (drush_get_option('use-existing', FALSE)) { $root = drush_get_option('root', FALSE); if (!$root) { return drush_set_error('QUICK_DRUPAL_NO_ROOT_SPECIFIED', 'Must specify site with --root when using --use-existing.'); @@ -897,6 +910,7 @@ function drush_core_quick_drupal_options(&$items) { 'no-server' => 'Avoid starting runserver (and browser) for the created Drupal site.', 'browser' => 'Optional name of a browser to open site in. If omitted the OS default browser will be used. Set --no-browser to disable.', 'use-name' => array('hidden' => TRUE, 'description' => 'Overrides "name" argument.'), + 'makefile' => 'Makefile to use. Makefile must specify which version of Drupal core to build.', ); $pm = pm_drush_command(); foreach ($pm['pm-download']['options'] as $option => $description) {