mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-27 12:18:43 +02:00
Update pull-repo.ps1
This commit is contained in:
parent
4fadebf14a
commit
035bafb668
@ -1,8 +1,8 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Pulls repository updates
|
Pulls Git repo updates
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script pulls updates for a local Git repository (including submodules).
|
This PowerShell script pulls updates into a local Git repository (including submodules).
|
||||||
.PARAMETER RepoDir
|
.PARAMETER RepoDir
|
||||||
Specifies the file path to the local Git repository (default is working directory)
|
Specifies the file path to the local Git repository (default is working directory)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
@ -29,7 +29,7 @@ try {
|
|||||||
$Result = (git -C "$RepoDir" status)
|
$Result = (git -C "$RepoDir" status)
|
||||||
if ("$Result" -match "HEAD detached at ") { throw "Currently in detached HEAD state (not on a branch!), so nothing to pull" }
|
if ("$Result" -match "HEAD detached at ") { throw "Currently in detached HEAD state (not on a branch!), so nothing to pull" }
|
||||||
|
|
||||||
Write-Host "⏳ (3/4) Pulling updates... " -noNewline
|
Write-Host "⏳ (3/4) Pulling latest updates..."
|
||||||
& git -C "$RepoDir" pull --recurse-submodules=yes
|
& git -C "$RepoDir" pull --recurse-submodules=yes
|
||||||
if ($lastExitCode -ne "0") { throw "'git pull' failed with exit code $lastExitCode" }
|
if ($lastExitCode -ne "0") { throw "'git pull' failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user