Added the option to use the Bitbucket downloads

This commit is contained in:
Stefan Woudstra 2020-02-05 13:52:40 +01:00
parent 3857481c65
commit fee73d566e
1 changed files with 8 additions and 1 deletions

View File

@ -141,8 +141,15 @@ if ( !class_exists('Puc_v4p8_Vcs_BitBucketApi', false) ):
* @return string
*/
protected function getDownloadUrl($ref) {
// Added functionality to allow download as method
if( $method == 'download' ) {
$endpoint = 'https://api.bitbucket.org/2.0/repositories/%s/%s/downloads/%s.zip';
} else {
$endpoint = 'https://bitbucket.org/%s/%s/get/%s.zip';
}
return sprintf(
'https://bitbucket.org/%s/%s/get/%s.zip',
$endpoint,
$this->username,
$this->repository,
$ref