Skip to content

Commit 200b5fe

Browse files
authored
Merge pull request #23 from jibran/support-drupal-pacakges
Added Drupal packages support.
2 parents 4021323 + 4bc047b commit 200b5fe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

composer-lock-diff

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ function getSourceRepoType($url) {
222222
if (preg_match('/^git@gitlab\..+:.+\.git$/', $url)) {
223223
return 'gitlab';
224224
}
225+
if (preg_match('/^git@git\.drupal\..+:.+\.git$/', $url)) {
226+
return 'drupal';
227+
}
225228

226229
if (! preg_match('/^http/i', $url)) {
227230
return 'unknown';
@@ -235,6 +238,8 @@ function getSourceRepoType($url) {
235238
return 'bitbucket';
236239
} elseif (strpos($host, 'gitlab') !== false) {
237240
return 'gitlab';
241+
} elseif (strpos($host, 'drupalcode') !== false) {
242+
return 'drupal';
238243
}
239244

240245
return 'unknown';
@@ -268,6 +273,11 @@ function formatCompareGitlab($url, $from, $to) {
268273
return sprintf('%s/compare/%s...%s', $url, urlencode($from), urlencode($to));
269274
}
270275

276+
function formatCompareDrupal($url, $from, $to) {
277+
$url = preg_replace('/\.git$/', '', $url);
278+
return sprintf('%s/compare/8.x-%s...8.x-%s', $url, substr(urlencode($from), 0, -2), substr(urlencode($to), 0, -2));
279+
}
280+
271281
function parseOpts() {
272282
$given = getopt('hp:', array('path:', 'from:', 'to:', 'md', 'json', 'pretty', 'no-links', 'only-prod', 'only-dev', 'help'));
273283

0 commit comments

Comments
 (0)