function drush_core_drupal_directory

8.0.x core.drush.inc drush_core_drupal_directory($target = 'root')
6.x core.drush.inc drush_core_drupal_directory($target = 'root')
7.x core.drush.inc drush_core_drupal_directory($target = 'root')
3.x core.drush.inc drush_core_drupal_directory($target = 'root')
4.x core.drush.inc drush_core_drupal_directory($target = 'root')
5.x core.drush.inc drush_core_drupal_directory($target = 'root')
master core.drush.inc drush_core_drupal_directory($target = 'root')

File

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

Code

function drush_core_drupal_directory($target = 'root') {
  $path = _drush_core_directory($target, drush_get_option('component', 'path'), drush_get_option('local', FALSE));

  // If _drush_core_directory is working right, it will turn
  // %blah into the path to the item referred to by the key 'blah'.
  // If there is no such key, then no replacement is done.  In the
  // case of the dd command, we will consider it an error if
  // any keys are -not- replaced in _drush_core_directory.
  if ((isset($path)) && (strpos($path, '%') === FALSE)) {
    drush_print($path);
  }
  else {
    return drush_set_error('DRUSH_TARGET_NOT_FOUND', dt("Target '!target' not found.", array('!target' => $target)));
  }

  return TRUE;
}