Skip to content

Commit

Permalink
fix: less restrictive git remote parsing (close #185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Silberman committed Jul 29, 2019
1 parent 9519fd8 commit 6088e3e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion packages/@best/config/src/__tests__/git.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { getGitInfo } from "../utils/git"

describe('config file resolution', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/@best/config/src/utils/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function getBranch(git: SimpleGit.SimpleGit): Promise<string> {

async function getRepository(git: SimpleGit.SimpleGit): Promise<{ owner: string, repo: string }> {
const url = await git.listRemote(['--get-url']);
const matches = url.trim().match(/^.+[:/]([a-zA-Z]+)\/([a-zA-Z]+).git$/);
const matches = url.trim().match(/^.+[:/](.+)\/(.+).git$/);
if (!matches) {
throw new Error('Unable to parse git repo');
}
Expand Down

0 comments on commit 6088e3e

Please sign in to comment.