Commit a542d71c authored by Jon Pugh's avatar Jon Pugh

Only show log messages if the flag is true.

parent cd6f791f
......@@ -464,7 +464,6 @@ function provision_process($command, $cwd = null, $label = 'Process', $env = arr
if (empty($command)) {
return;
}
drush_log("[$label] $command", 'p_command');
// Merge in env vars, inheriting the CLI's
if (is_array($env)) {
......@@ -480,6 +479,8 @@ function provision_process($command, $cwd = null, $label = 'Process', $env = arr
$process = new \Symfony\Component\Process\Process(escapeshellcmd($command), $cwd, $env);
$process->setTimeout(NULL);
if ($log_output) {
drush_log("[$label] $command", 'p_command');
$exit_code = $process->run(function ($type, $buffer) {
drush_log($buffer, 'p_info');
});
......@@ -493,11 +494,17 @@ function provision_process($command, $cwd = null, $label = 'Process', $env = arr
// check exit code
if ($exit_code === 0) {
drush_log('', 'p_ok');
if ($log_output) {
drush_log('', 'p_ok');
}
return $process->getOutput();
}
else {
drush_log('', 'p_error');
if ($log_output) {
drush_log('', 'p_error');
}
if ($throw_drush_error) {
drush_set_error('PROVISION_PROCESS_ERROR', dt($error_message));
......
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