Skip to content

Commit ce61230

Browse files
[Refactor] Remove duplication in git latest tag retrieval
Refactors getLatestTagFromDirectory in packages/cli-kit/src/public/node/git.ts to use the existing getLatestTag utility, removing duplicated git command execution.
1 parent 49e3745 commit ce61230

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • packages/cli-kit/src/public/node

packages/cli-kit/src/public/node/git.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ export async function downloadGitRepository(cloneOptions: GitCloneOptions): Prom
233233
}
234234

235235
async function getLatestTagFromDirectory(directory: string, repoUrl: string): Promise<string> {
236-
const stdout = await gitCommand(['describe', '--tags', '--abbrev=0'], directory)
237-
const tag = stdout.trim()
236+
const tag = await getLatestTag(directory)
238237

239238
if (!tag) {
240239
throw new AbortError(`Couldn't obtain the most recent tag of the repository ${repoUrl}`)

0 commit comments

Comments
 (0)