Improve the output

This commit is contained in:
Markus Fleschutz
2022-01-18 21:02:19 +01:00
parent e8df5794cd
commit fd7b60182d
7 changed files with 31 additions and 34 deletions

View File

@ -1,6 +1,6 @@
<#
.SYNOPSIS
Pulls updates for a Git repository (including submodules)
Pulls updates for a Git repository
.DESCRIPTION
This script pulls updates for a local Git repository (including submodules).
.PARAMETER RepoDir
@ -8,7 +8,7 @@
.EXAMPLE
PS> ./pull-repo C:\MyRepo
.NOTES
Author: Markus Fleschutz · License: CC0
Author: Markus Fleschutz / License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
@ -18,7 +18,7 @@ param([string]$RepoDir = "$PWD")
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
"(1/3) Checking requirements... "
"Step 1/3: Checking requirements... "
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"
@ -29,11 +29,11 @@ try {
exit 0 # success
}
"(2/3) Pulling updates... "
"Step 2/3: Pulling updates... "
& git pull --recurse-submodules --jobs=4
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
"(3/3) Updating submodules... "
"Step 3/3: Updating submodules... "
& git submodule update --init --recursive
if ($lastExitCode -ne "0") { throw "'git submodule update' failed" }