🎨 update getRepoName
This commit is contained in:
parent
a893e2ab43
commit
71dc510bbc
2 changed files with 10 additions and 1 deletions
|
|
@ -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 = [
|
||||
|
|
|
|||
|
|
@ -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[]> {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue