fix(coding-agent): normalize raw git URLs in extension source matching
- Handle https://github.com/... URLs as git sources (not local) - Strip .git suffix for consistent matching
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -32,3 +32,4 @@ out.jsonl
|
||||
pi-*.html
|
||||
out.html
|
||||
packages/coding-agent/binaries/
|
||||
todo.md
|
||||
|
||||
@@ -88,7 +88,12 @@ function normalizeExtensionSource(source: string): { type: "npm" | "git" | "loca
|
||||
}
|
||||
if (source.startsWith("git:")) {
|
||||
const repo = source.slice("git:".length).trim().split("@")[0] ?? "";
|
||||
return { type: "git", key: repo.replace(/^https?:\/\//, "") };
|
||||
return { type: "git", key: repo.replace(/^https?:\/\//, "").replace(/\.git$/, "") };
|
||||
}
|
||||
// Raw git URLs
|
||||
if (source.startsWith("https://") || source.startsWith("http://")) {
|
||||
const repo = source.split("@")[0] ?? "";
|
||||
return { type: "git", key: repo.replace(/^https?:\/\//, "").replace(/\.git$/, "") };
|
||||
}
|
||||
return { type: "local", key: source };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user