mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 06:02:42 +00:00
refactor(coding-agent): centralize git url detection
This commit is contained in:
parent
4719929f6a
commit
254c00b788
3 changed files with 8 additions and 37 deletions
6
packages/coding-agent/src/utils/git.ts
Normal file
6
packages/coding-agent/src/utils/git.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
const GIT_HOSTS = ["github.com", "gitlab.com", "bitbucket.org", "codeberg.org"];
|
||||
|
||||
export function looksLikeGitUrl(source: string): boolean {
|
||||
const normalized = source.replace(/^https?:\/\//, "");
|
||||
return GIT_HOSTS.some((host) => normalized.startsWith(`${host}/`));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue