Commit 7b72e59c authored by Mathieu Lutfy's avatar Mathieu Lutfy Committed by Aegir user

extensions/extensions-directory#25: extdir.drush.inc: fix .zip field for extensions on lab.c.o

parent 867babda
......@@ -418,6 +418,17 @@ function _extdir_git_getdurl($giturl, $tag) {
}
return "$projUrl/archive/$tag.zip";
}
elseif (substr($giturl, 0, 24) == 'https://lab.civicrm.org/') {
$projUrl = $giturl;
if (preg_match('/\.git$/', $projUrl)) {
// In github URLs, the '.git' extension is optional.
$projUrl = substr($giturl, 0, -4);
}
if (preg_match('/^https:\/\/lab.civicrm.org\/extensions\/([\.0-9A-Za-z]+)/', $projUrl, $matches)) {
return "$projUrl/-/archive/$tag/{$matches[1]}-{$tag}.zip";
}
return FALSE;
}
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment