function drush_pm_releases

8.0.x pm.drush.inc drush_pm_releases()
6.x pm.drush.inc drush_pm_releases()
7.x pm.drush.inc drush_pm_releases()
3.x pm.drush.inc drush_pm_releases()
4.x pm.drush.inc drush_pm_releases()
5.x pm.drush.inc drush_pm_releases()
master pm.drush.inc drush_pm_releases()

Command callback. Show available releases for given project(s).

File

commands/pm/pm.drush.inc, line 1163
The drush Project Manager

Code

function drush_pm_releases() {
  if (!$requests = pm_parse_arguments(func_get_args(), FALSE)) {
    $requests = array('drupal');
  }

  // Parse out project name and version.
  $requests = pm_parse_project_version($requests);

  $info = release_info_get_releases($requests);
  if (!$info) {
    return drush_log(dt('No valid projects given.'), 'ok');
  }

  $all = drush_get_option('all', FALSE);
  $dev = drush_get_option('dev', FALSE);
  foreach ($info as $name => $project) {
    $header = dt('------- RELEASES FOR \'!name\' PROJECT -------', array('!name' => strtoupper($name)));
    $rows = array();
    $rows[] = array(dt('Release'), dt('Date'), dt('Status'));
    $releases = release_info_filter_releases($project['releases'], $all, $dev);
    foreach ($releases as $release) {
      $rows[] = array(
        $release['version'],
        gmdate('Y-M-d', $release['date']),
        implode(', ', $release['release_status']),
      );
    }
    drush_print($header);
    drush_print_table($rows, TRUE, array(0 => 14));
  }

  return $info;
}