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')

Command callback.

File

commands/core/core.drush.inc, line 1259
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-only', 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 ($path && (strpos($path, '%') === FALSE)) {
    return $path;
  }
  else {
    return drush_set_error('DRUSH_TARGET_NOT_FOUND', dt("Target '!target' not found.", array('!target' => $target)));
  }
}