mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-05-24 09:22:14 +02:00
fix github download strategy for https checkouts
This commit is contained in:
parent
05ae63bb51
commit
5e1f76ef97
|
@ -73,11 +73,11 @@ class GithubDownloadTask extends BaseStrategyTaskAbstract implements IsReleaseAw
|
|||
$gitRemoteUrl = exec('git config --get remote.origin.url');
|
||||
if(0 === strpos($gitRemoteUrl,'git@github.com')){
|
||||
$projectName = substr($gitRemoteUrl,strpos($gitRemoteUrl,':')+1,-4);
|
||||
} elseif(0 === strpos($gitRemoteUrl,'https://github.com')){
|
||||
$projectName = substr($gitRemoteUrl,strpos($gitRemoteUrl,'/',8)+1,-4);
|
||||
} elseif(preg_match('/^https:\/\/([a-zA-Z0-9._-]+@)?github.com/', $gitRemoteUrl)){
|
||||
$projectName = substr($gitRemoteUrl,strpos($gitRemoteUrl,'github.com/',8)+11,-4);
|
||||
} elseif(empty($gitRemoteUrl)) {
|
||||
throw new Exception('cannot determine remote url.');
|
||||
} elseif(false === strpos($gitRemoteUrl,'github.com' === 0)) {
|
||||
} elseif(false === strpos($gitRemoteUrl, 'github.com')) {
|
||||
throw new Exception('repository not hosted on github, cannot use this strategy.');
|
||||
} else {
|
||||
throw new Exception('cannot parse remote url.');
|
||||
|
|
Loading…
Reference in a new issue