function _print_drush_github_latest_url in Printer, email and PDF versions 7.2
Get filename of latest from github.
Parameters
string $github_url: The github URL to the latest project release.
Return value
string The URL to the latest file release.
1 call to _print_drush_github_latest_url()
- _print_drush_download_lib in includes/
print.drush.inc - Download and extract the lib.
File
- includes/
print.drush.inc, line 72 - Common drush functions for the print submodules.
Code
function _print_drush_github_latest_url($github_url) {
$filename = _print_drush_download_file($github_url);
$contents = file_get_contents($filename);
drush_op('unlink', $filename);
$json = json_decode($contents);
if (isset($json->assets[0])) {
$download_url = $json->assets[0]->browser_download_url;
}
else {
// Try the zipball_url.
$download_url = $json->zipball_url;
}
return $download_url;
}