Improve list-latest-tag.ps1 and list-latest-tags.ps1

This commit is contained in:
Markus Fleschutz 2021-08-12 08:42:53 +02:00
parent 5b586a8511
commit 5a434e2dc6
2 changed files with 6 additions and 4 deletions

View File

@ -25,8 +25,9 @@ try {
# & git -C "$RepoDir" fetch --tags
# if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" }
$LatestTag = (git -C "$RepoDir" describe --tags --abbrev=0 --always)
"🔖$LatestTag"
$LatestTagCommitID = (git -C "$RepoDir" rev-list --tags --max-count=1)
$LatestTag = (git -C "$RepoDir" describe --tags $LatestTagCommitID)
"🔖$LatestTag ($LatestTagCommitID)"
exit 0
} catch {

View File

@ -31,8 +31,9 @@ try {
# & git -C "$Folder" fetch --tags
# if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" }
$LatestTag = (git -C "$Folder" describe --tags --abbrev=0 --always)
"* $FolderName $LatestTag"
$LatestTagCommitID = (git -C "$Folder" rev-list --tags --max-count=1)
$LatestTag = (git -C "$Folder" describe --tags $LatestTagCommitID)
"* $FolderName $LatestTag ($LatestTagCommitID)"
}
exit 0
} catch {