We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 892ec04 commit 177ca32Copy full SHA for 177ca32
bin/utils.js
@@ -32,15 +32,18 @@ function gitURL(path) {
32
// Poorman's parsing
33
// Parse a git URL to a github ID : username/reponame
34
function githubID(_url) {
35
+ // Remove .git if it's in _url
36
+ var sliceEnd = _url.slice(-4) === '.git' ? -4 : _url.length;
37
+
38
// Detect HTTPS repos
39
var parsed = url.parse(_url);
40
if(parsed.protocol === 'https:' && parsed.host === 'github.com') {
- return parsed.path.slice(1, -4);
41
+ return parsed.path.slice(1, sliceEnd);
42
}
43
44
// Detect SSH repos
45
if(_url.indexOf('git@') === 0) {
- return _url.split(':', 2)[1].slice(0, -4);
46
+ return _url.split(':', 2)[1].slice(0, sliceEnd);
47
48
49
// None found
0 commit comments