mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Enhance list-latest-tag.ps1
This commit is contained in:
parent
478d62aa89
commit
2345cc14c8
@ -1,4 +1,4 @@
|
||||
<#
|
||||
<#
|
||||
.SYNTAX list-latest-tag.ps1 [<repo-dir>]
|
||||
.DESCRIPTION lists the latest tag on the current branch in a Git repository
|
||||
.LINK https://github.com/fleschutz/PowerShell
|
||||
@ -17,10 +17,11 @@ try {
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
& git fetch --all --recurse-submodules --jobs=4
|
||||
& git fetch
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
||||
|
||||
& git describe --tags --abbrev=0
|
||||
$Tag = (git describe --tags --abbrev=0)
|
||||
"🔖$Tag"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user