| 165 | }; |
| 166 | |
| 167 | async getRepoName(dir: string): Promise<string | undefined> { |
| 168 | const repo = await this.getRepo(dir); |
| 169 | const remotes = repo?.state.remotes; |
| 170 | if (!remotes) { |
| 171 | return undefined; |
| 172 | } |
| 173 | const remote = |
| 174 | remotes?.find((r: any) => r.name === "origin") ?? remotes?.[0]; |
| 175 | if (!remote) { |
| 176 | return undefined; |
| 177 | } |
| 178 | const ownerAndRepo = remote.fetchUrl |
| 179 | ?.replace(".git", "") |
| 180 | .split("/") |
| 181 | .slice(-2); |
| 182 | return ownerAndRepo?.join("/"); |
| 183 | } |
| 184 | |
| 185 | async getTags(artifactId: string): Promise<IndexTag[]> { |
| 186 | const workspaceDirs = await this.getWorkspaceDirs(); |