mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-24 19:08:27 +02:00
Improve list-tags.ps1
This commit is contained in:
parent
d572bf467c
commit
5603555d48
@ -1,12 +1,12 @@
|
|||||||
#!/bin/powershell
|
#!/bin/powershell
|
||||||
<#
|
<#
|
||||||
.SYNTAX ./list-tags.ps1 [<repo-dir>]
|
.SYNTAX ./list-tags.ps1 [<repo-dir>] [<pattern>]
|
||||||
.DESCRIPTION lists all tags in the current/given Git repository
|
.DESCRIPTION lists all tags in the current/given Git repository
|
||||||
.LINK https://github.com/fleschutz/PowerShell
|
.LINK https://github.com/fleschutz/PowerShell
|
||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param($RepoDir = "$PWD")
|
param($RepoDir = "$PWD", $Pattern="*")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
write-output "Fetching updates for Git repository $RepoDir ..."
|
write-output "Fetching updates for Git repository $RepoDir ..."
|
||||||
@ -24,8 +24,8 @@ try {
|
|||||||
write-output "List of Git Tags"
|
write-output "List of Git Tags"
|
||||||
write-output "----------------"
|
write-output "----------------"
|
||||||
|
|
||||||
& git tag
|
& git tag --list "$Pattern"
|
||||||
if ($lastExitCode -ne "0") { throw "'git tag' failed" }
|
if ($lastExitCode -ne "0") { throw "'git tag --list' failed" }
|
||||||
|
|
||||||
write-output ""
|
write-output ""
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user