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

This commit is contained in:
Markus Fleschutz 2021-08-11 07:49:11 +02:00
parent 16c1026a4c
commit 5b586a8511
2 changed files with 9 additions and 9 deletions

View File

@ -20,14 +20,14 @@ try {
$Null = (git --version) $Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
$RepoDirName = (get-item "$RepoDir").Name # $RepoDirName = (get-item "$RepoDir").Name
"🢃 Fetching updates for 📂$RepoDirName ..." # "🢃 Fetching updates for 📂$RepoDirName ..."
# & git -C "$RepoDir" fetch --tags
# if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" }
& git -C "$RepoDir" fetch --tags $LatestTag = (git -C "$RepoDir" describe --tags --abbrev=0 --always)
if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } "🔖$LatestTag"
$Tag = (git -C "$RepoDir" describe --tags --abbrev=0)
"🔖$Tag"
exit 0 exit 0
} catch { } catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -28,10 +28,10 @@ try {
foreach ($Folder in $Folders) { foreach ($Folder in $Folders) {
$FolderName = (get-item "$Folder").Name $FolderName = (get-item "$Folder").Name
& git -C "$Folder" fetch --tags # & git -C "$Folder" fetch --tags
if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } # if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" }
$LatestTag = (git -C "$Folder" describe --tags --abbrev=0) $LatestTag = (git -C "$Folder" describe --tags --abbrev=0 --always)
"* $FolderName $LatestTag" "* $FolderName $LatestTag"
} }
exit 0 exit 0