Improve the scripts

This commit is contained in:
Markus Fleschutz
2021-04-15 16:54:59 +02:00
parent 24fffac7b8
commit 1542765c41
4 changed files with 13 additions and 14 deletions

View File

@ -9,16 +9,17 @@
param($RepoDir = "$PWD")
try {
"Fetching updates for Git repository $RepoDir ..."
"Fetching updates for Git repository $($RepoDir)..."
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"
& git fetch --all --recurse-submodules --jobs=4
if ($lastExitCode -ne "0") { # retry once:
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" }
if ($lastExitCode -ne "0") { throw "'git fetch' failed (twice)" }
}
exit 0
} catch {