Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for psite-uuid multiple arguments #129

Merged
merged 3 commits into from
Mar 6, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions terminus.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function terminus_drush_command() {
$items['pantheon-site-uuid'] = array(
'description' => "Get the site UUID based on the name.",
'arguments' => array(
'site' => 'Name of the site.',
'sites' => 'A list of site names.',
),
'examples' => array(
'drush psite-uuid mysite --nocache' => 'Get the UUID of your site.',
Expand Down Expand Up @@ -1662,10 +1662,18 @@ function drush_terminus_pantheon_site_environment_redis_clear($site_uuid = FALSE
/**
* Get a site uuid based on the name.
*/
function drush_terminus_pantheon_site_uuid($site_name) {
function drush_terminus_pantheon_site_uuid() {
$site_names = pm_parse_arguments(func_get_args());
terminus_bootstrap();
$site_uuid = terminus_get_site_uuid_by_name($site_name);
drush_print($site_uuid);
foreach ($site_names as $site_name) {
if ($site_uuid = terminus_get_site_uuid_by_name($site_name)) {
$output = $site_name . ': ' . $site_uuid;
}
else {
$output = dt('@site_name: No uuid found.', array('@site_name' => $site_name));
}
drush_print($output);
}
return TRUE;
}

Expand Down Expand Up @@ -4180,6 +4188,7 @@ function terminus_get_site_uuid_by_name($site_name) {
# Get all the orgs where they are an admin.
$result = terminus_api_user_organizations($user_uuid);
$orgs = json_decode($result['json']);
$check_orgs = array();
foreach ($orgs as $org => $data) {
if ($data->admin) {
$check_orgs[] = $org;
Expand Down