You are here

protected function Provision_ShellCommand::runCommand in Aegir Objects 7.3

Run a command in a subshell, and post the output once complete.

File

drush/Provision/ShellCommand.php, line 65

Class

Provision_ShellCommand

Code

protected function runCommand($command) {
  $this
    ->notice("Running `{$command}`");
  if (drush_shell_exec($command)) {
    $this
      ->success(dt('Command succeeded.'));
    if ($output = drush_shell_exec_output()) {
      $this
        ->success(implode("\n", $output));
    }
    return TRUE;
  }
  else {
    $this
      ->error(dt('Command failed. The specific errors follow:'));
    if ($output = drush_shell_exec_output()) {
      $this
        ->error(implode("\n", $output));
    }
    return FALSE;
  }
}