Skip to content

Commit

Permalink
Issue #255: Fix drush dl for contrib projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
quicksketch authored Apr 15, 2024
1 parent 7d7cfe6 commit dae0712
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions commands/pm/backdrop_pm.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function backdrop_command_pm_download() {
else {
foreach ($projects as $project) {
if ($project != 'backdrop') {
$html = backdrop_pm_get_from_github(
$url = backdrop_pm_get_from_github(
"https://github.com/backdrop-contrib/$project/releases/latest"
);

Expand All @@ -130,8 +130,6 @@ function backdrop_command_pm_download() {
);

$project_path = backdrop_pm_get_path($tags);
$html = explode("\"", $html);
$url = $html[1];
$latest = explode('/', $url);
$latest = array_reverse($latest);

Expand Down Expand Up @@ -187,9 +185,11 @@ function backdrop_pm_get_from_github($url) {
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
$content = curl_exec($ch);
curl_exec($ch);
$curl_info = curl_getinfo($ch);
$redirect_url = "$curl_info[redirect_url]";
curl_close($ch);
return $content;
return $redirect_url;
}

/**
Expand Down

0 comments on commit dae0712

Please sign in to comment.