mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 00:54:04 +01:00
Update list-tags.ps1
This commit is contained in:
parent
d0fe73ce11
commit
52eb6034bc
@ -2,9 +2,9 @@
|
||||
.SYNOPSIS
|
||||
Lists all tags in a Git repository
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists all tags in the given Git repository.
|
||||
This PowerShell script lists all tags in a Git repository.
|
||||
.PARAMETER RepoDir
|
||||
Specifies the path to the Git repository
|
||||
Specifies the path to the Git repository (current working directory by default)
|
||||
.PARAMETER SearchPattern
|
||||
Specifies the search pattern (anything by default)
|
||||
.EXAMPLE
|
||||
@ -23,16 +23,18 @@
|
||||
param([string]$RepoDir = "$PWD", [string]$SearchPattern="*")
|
||||
|
||||
try {
|
||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
|
||||
Write-Progress "⏳ (1/3) Searching for Git executable... "
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
write-progress "🢃 Fetching latest tags..."
|
||||
Write-Progress "⏳ (2/3) Checking folder... "
|
||||
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"
|
||||
Write-Progress -completed "Fetched"
|
||||
""
|
||||
"Tag Description"
|
||||
"--- -----------"
|
||||
@ -43,4 +45,4 @@ try {
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user