Skip to content

Commit

Permalink
Silence a warning when an alias record does not contian a 'root' elem…
Browse files Browse the repository at this point in the history
…ent.
  • Loading branch information
greg-1-anderson committed Feb 9, 2015
1 parent ee7fedf commit 21ff10a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion commands/core/sitealias.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function sitealias_drush_command() {
'examples' => array(
'drush site-alias' => 'List all alias records known to drush.',
'drush site-alias @dev' => 'Print an alias record for the alias \'dev\'.',
'drush @none site-alias' => 'Print only actual aliases; omit multisites from the local Drupal installation.',
),
'topics' => array('docs-aliases'),
);
Expand Down Expand Up @@ -93,7 +94,11 @@ function sitealias_site_set_complete() {
* is the site specification for the given alias.
*/
function _drush_sitealias_alias_list() {
return drush_get_context('site-aliases');
$all_aliases = drush_get_context('site-aliases');
foreach($all_aliases as $key => $value) {
$result['@' . $key] = $value;
}
return $result;
}

/**
Expand Down
4 changes: 3 additions & 1 deletion includes/sitealias.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,9 @@ function _drush_sitealias_add_static_defaults(&$alias_record) {
$alias_record['path-aliases'] = array();
}
// If there is a 'root' entry, then copy it to the '%root' path alias
$alias_record['path-aliases']['%root'] = $alias_record['root'];
if (isset($alias_record['root'])) {
$alias_record['path-aliases']['%root'] = $alias_record['root'];
}
}
}

Expand Down

0 comments on commit 21ff10a

Please sign in to comment.