function drush_os

8.0.x exec.inc drush_os($site_record = NULL)
6.x exec.inc drush_os($site_record = NULL)
7.x exec.inc drush_os($site_record = NULL)
4.x drush.inc drush_os($site_record = NULL)
5.x exec.inc drush_os($site_record = NULL)
master exec.inc drush_os($site_record = NULL)

Determine the appropriate os value for the specified site record

@returns NULL for 'same as local machine', 'Windows' or 'Linux'.

Related topics

1 call to drush_os()
_drush_backend_generate_command_sitealias in includes/backend.inc
Generate a command to execute.

File

includes/drush.inc, line 1361
The drush API implementation and helpers.

Code

function drush_os($site_record = NULL) {
  // Default to $os = NULL, meaning 'same as local machine'
  $os = NULL;
  // If the site record has an 'os' element, use it
  if (isset($site_record) && array_key_exists('os', $site_record)) {
    $os = $site_record['os'];
  }
  // Otherwise, we will assume that all remote machines are Linux
  // (or whatever value 'remote-os' is set to in drushrc.php).
  elseif (isset($site_record) && array_key_exists('remote-host', $site_record) && !empty($site_record['remote-host'])) {
    $os = drush_get_option('remote-os', 'Linux');
  }

  return $os;
}