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

4 calls to drush_os()
drush_backend_invoke_concurrent in includes/backend.inc
Execute a new local or remote command in a new process.
drush_set_environment_vars in includes/environment.inc
Set Env. Variables for given site-alias.
drush_shell_proc_build in includes/exec.inc
Build an SSH string including an optional fragment of bash. Commands that use this should also merge drush_shell_proc_build_options() into their command options.
_drush_backend_generate_command in includes/backend.inc
Generate a command to execute.

File

includes/exec.inc, line 272
Functions for executing system commands. (e.g. exec(), system(), ...).

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;
}