Skip to content

Commit

Permalink
fix(project-info): more explicit origin repo url matching
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastrajan committed Jan 3, 2023
1 parent 500e17f commit e2f08dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/services/project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const findProjectRepositoriesMaven = (): string[] => {
export const findProjectRepositoriesRepo = (): string[] => {
const gitConfigPath = findFiles('.git/config')[0];
const gitConfig = readFile(gitConfigPath);
const repoUrl = /url\s?=\s?(?<url>.*)/.exec(gitConfig)?.groups?.url;
const repoUrl = /\[remote.?["']origin["']\]\n\s*url\s?=\s?(?<url>.*)/.exec(gitConfig)?.groups?.url;
if (repoUrl && repoUrl.length) {
return [sanitizeRepositoryUrl(repoUrl)];
} else {
Expand Down

0 comments on commit e2f08dc

Please sign in to comment.