Commit b61c7e92 authored by Jon Pugh's avatar Jon Pugh

Issue #2952997: Run composer install on remote server.

parent 5fc04bc0
......@@ -104,13 +104,15 @@ function drush_provision_drupal_pre_provision_verify() {
// Composer Install command: Do not interact, do not show download progress.
// Customizable by setting drush option 'provision_composer_install_command'
$composer_command = drush_get_option('provision_composer_install_command', 'composer install --no-interaction --no-progress --no-dev');
$command = "{$composer_command} --working-dir={$composer_directory}";
drush_log(dt("Running command @command", array(
'@command' => $composer_command
'@command' => $command
)), 'ok');
$start = time();
// @TODO: Implement Symfony Process component for line-by-line output logging.
if (drush_shell_cd_and_exec($composer_directory, $composer_command)) {
if (d()->web_server->shell_exec($command)) {
$stop = time();
$output = implode("\n", drush_shell_exec_output());
......@@ -118,15 +120,14 @@ function drush_provision_drupal_pre_provision_verify() {
drush_log($output, $log_status);
drush_log(dt(strpos($output, 'Warning:') . "Command ran successfully in @times: @command", array(
'@command' => $composer_command,
'@command' => $command,
'@time' => $stop - $start,
)), $log_status);
}
else {
drush_log(implode("\n", drush_shell_exec_output()), 'error');
drush_set_error('DRUSH_COMPOSER_ERROR', dt('The composer command failed in @dir: @command', array(
'@dir' => $composer_directory,
'@command' => $composer_command,
drush_set_error('DRUSH_COMPOSER_ERROR', dt('The composer command failed: @command', array(
'@command' => $command,
)));
}
}
......
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