function _drush_core_execute_cmd

8.0.x core.drush.inc _drush_core_execute_cmd($site, $cmd)
6.x core.drush.inc _drush_core_execute_cmd($site, $cmd)
7.x core.drush.inc _drush_core_execute_cmd($site, $cmd)
5.x core.drush.inc _drush_core_execute_cmd($site, $cmd)
master core.drush.inc _drush_core_execute_cmd($site, $cmd)

Helper function for drush_core_execute: run one shell command

1 call to _drush_core_execute_cmd()
drush_core_execute in commands/core/core.drush.inc
Command callback. Execute specified shell code. Often used by shell aliases that start with !.

File

commands/core/core.drush.inc, line 1358
Core drush commands.

Code

function _drush_core_execute_cmd($site, $cmd) {
  if (!empty($site['remote-host'])) {
    // Remote, so execute an ssh command with a bash fragment at the end.
    $exec = drush_shell_proc_build($site, $cmd, TRUE);
    return (drush_shell_proc_open($exec) == 0);
  }
  elseif (!empty($site['root']) && is_dir($site['root'])) {
    return (drush_shell_proc_open('cd ' . drush_escapeshellarg($site['root']) . ' && ' . $cmd) == 0);
  }
  return (drush_shell_proc_open($cmd) == 0);
}