Skip to content

Commit 9eda326

Browse files
committed
fix(cli): no options works with .git repos
Wasn't chopping off the .git which optionally hangs on the end of repo names...
1 parent df49c85 commit 9eda326

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ const parseGitURL = new RegExp('.*github\\.com[:/]([^/]+)\\/(.+)\\n?$')
2525

2626
const getCurrentRepoInfo = () => shellOut(gitConfigCommand)
2727
.then(x => parseGitURL.exec(x))
28-
.then(x => { return {user: x[1], repo: x[2]} })
28+
.then(x => {
29+
let repo = x[2]
30+
if (repo.endsWith('.git')) {
31+
repo = repo.substr(0, repo.length - 4)
32+
}
33+
return {user: x[1], repo}
34+
})
2935

3036
//
3137
// CSV Output

0 commit comments

Comments
 (0)