Commit 82cf9564 authored by Jon Pugh's avatar Jon Pugh

Issue #2937147: Add Composer support directly to Provision.

  - If check for shell_exec fails, log a warning.
parent 85fbb147
......@@ -102,8 +102,12 @@ function drush_provision_drupal_pre_provision_verify() {
}
// Composer Install Support
// If drush variable provision_composer_install_platforms is not set to FALSE, run composer install.
if (drush_get_option('provision_composer_install_platforms', TRUE) && shell_exec('which composer')) {
// Step 0: if drush variable allows composer install on platforms, and check for composer executable fails, show warning.
if (drush_get_option('provision_composer_install_platforms', TRUE) && !shell_exec('composer')) {
drush_log(dt('The composer exectuable was not found. Install composer using instructions located at https://getcomposer.org/doc/00-intro.md#globally or, if you wish to disable composer install, set "provision_composer_install_platforms" to FALSE in the ~/.drush/drushrc.php file.'), 'warning');
}
// If drush variable allows composer install on platforms (and composer exec passed)...
elseif (drush_get_option('provision_composer_install_platforms', TRUE)) {
// Detect composer-based platform and run composer install if it has not been run yet.
// Step 1: Look for composer directory. Could be Drupal root. Could be the git repo_root.
if (provision_file()->exists(d()->root . DIRECTORY_SEPARATOR . 'composer.json')->status()) {
......
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