mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-15 02:19:39 +01:00
Updated list-tags.ps1
This commit is contained in:
parent
b360ab234b
commit
411756abc6
@ -23,17 +23,18 @@
|
|||||||
param([string]$repoDir = "$PWD", [string]$searchPattern="*")
|
param([string]$repoDir = "$PWD", [string]$searchPattern="*")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Write-Progress "(1/3) Searching for Git executable... "
|
Write-Progress "(1/4) Searching for Git executable... "
|
||||||
$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" }
|
||||||
|
|
||||||
Write-Progress "(2/3) Checking local repository... "
|
Write-Progress "(2/4) Checking local repository... "
|
||||||
if (-not(Test-Path "$repoDir" -pathType container)) { throw "Can't access directory: $repoDir" }
|
if (-not(Test-Path "$repoDir" -pathType container)) { throw "Can't access directory: $repoDir" }
|
||||||
|
|
||||||
Write-Progress "(3/3) Updating Git tags from remote..."
|
Write-Progress "(3/4) Fetching newer Git tags..."
|
||||||
& git -C "$repoDir" fetch --tags
|
& git -C "$repoDir" fetch --tags
|
||||||
if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" }
|
if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" }
|
||||||
|
|
||||||
|
Write-Progress "(4/4) Fetching out-dated Git tags..."
|
||||||
& git -C "$repoDir" fetch --prune-tags
|
& git -C "$repoDir" fetch --prune-tags
|
||||||
if ($lastExitCode -ne "0") { throw "'git fetch --prune-tags' failed" }
|
if ($lastExitCode -ne "0") { throw "'git fetch --prune-tags' failed" }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user