From 2551930aed087a57eedccf26c29f038f07a9cff2 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 9 Aug 2023 09:59:29 +0200 Subject: [PATCH] Update list-tags.ps1 --- Scripts/list-tags.ps1 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Scripts/list-tags.ps1 b/Scripts/list-tags.ps1 index fe9b1755..2c7ea03c 100755 --- a/Scripts/list-tags.ps1 +++ b/Scripts/list-tags.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Lists all tags in a Git repository + Lists all tags in a repository .DESCRIPTION - This PowerShell script lists all tags in a Git repository. + This PowerShell script fetches and lists all tags in a Git repository. .PARAMETER RepoDir Specifies the path to the Git repository (current working directory by default) .PARAMETER SearchPattern @@ -27,20 +27,18 @@ try { $Null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - Write-Progress "⏳ (2/3) Checking folder... " + Write-Progress "⏳ (2/3) Checking local repository... " if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" } Write-Progress "⏳ (3/3) Fetching latest tags..." - & git -C "$RepoDir" fetch --all --tags --quiet - if ($lastExitCode -ne "0") { throw "'git fetch --all --tags' failed" } - - Write-Progress -completed "Fetched" - "" + & git -C "$RepoDir" fetch --tags + if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } + Write-Progress -completed "." + "" "Tag Description" "--- -----------" & git -C "$RepoDir" tag --list "$SearchPattern" -n if ($lastExitCode -ne "0") { throw "'git tag --list' failed" } - exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"