Change to use fetch-repo.ps1

This commit is contained in:
Markus Fleschutz
2021-04-15 16:40:10 +02:00
parent e9c4c6415f
commit 24fffac7b8
7 changed files with 12 additions and 21 deletions

View File

@ -14,17 +14,12 @@ try {
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"
& 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
if ($lastExitCode -ne "0") { # retry once:
start-sleep -milliseconds 1000
& git fetch --all --recurse-submodules --jobs=1
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
}
write-host -foregroundColor green "OK - fetched updates for Git repository $RepoDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"