From 5e1f76ef97a379ec3903acad9826ead3a7857165 Mon Sep 17 00:00:00 2001 From: Sander Jansma Date: Thu, 19 May 2016 10:52:53 +0200 Subject: [PATCH] fix github download strategy for https checkouts --- .../Newcraft/Deployment/Strategy/GithubDownloadTask.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mage/Task/Newcraft/Deployment/Strategy/GithubDownloadTask.php b/Mage/Task/Newcraft/Deployment/Strategy/GithubDownloadTask.php index 242299b..9fa266b 100644 --- a/Mage/Task/Newcraft/Deployment/Strategy/GithubDownloadTask.php +++ b/Mage/Task/Newcraft/Deployment/Strategy/GithubDownloadTask.php @@ -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.');