🎨 update getRepoName

This commit is contained in:
Nate Sesti 2024-03-28 20:48:35 -07:00
parent a893e2ab43
commit 71dc510bbc
2 changed files with 10 additions and 1 deletions

View file

@ -52,6 +52,8 @@ const DEFAULT_IGNORE_FILETYPES = [
"*.webp",
"*.db",
"*.sqlite",
"*.wasm",
"*.plist",
];
export const defaultIgnoreFile = ignore().add(DEFAULT_IGNORE_FILETYPES);
const DEFAULT_IGNORE_DIRS = [

View file

@ -30,7 +30,14 @@ class VsCodeIde implements IDE {
async getRepoName(dir: string): Promise<string | undefined> {
const repo = await this.getRepo(vscode.Uri.file(dir));
return repo?.state.HEAD?.name;
const remote =
repo.repository.remotes.find((r: any) => r.name === "origin") ??
repo.repository.remotes[0];
const ownerAndRepo = remote.fetchUrl
.replace(".git", "")
.split("/")
.slice(-2);
return ownerAndRepo.join("/");
}
async getTags(artifactId: string): Promise<IndexTag[]> {