Add git submodule update

This commit is contained in:
Markus Fleschutz 2021-06-16 08:38:33 +02:00
parent 5e79406090
commit dc1cf899c2
2 changed files with 8 additions and 4 deletions

View File

@ -8,6 +8,7 @@
param($RepoDir = "$PWD")
try {
"🢃 Pulling updates..."
$StopWatch = [system.diagnostics.stopwatch]::startNew()
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
@ -20,10 +21,12 @@ try {
exit 0
}
"🢃 Pulling updates..."
& git pull --recurse-submodules --jobs=4
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
& git submodule update --init --recursive
if ($lastExitCode -ne "0") { throw "'git submodule update' failed" }
$RepoDirName = (get-item "$RepoDir").Name
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ pulled updates for Git repository 📂$RepoDirName in $Elapsed sec"

View File

@ -25,9 +25,10 @@ try {
"🢃 Pulling 📂$FolderName..."
& git -C "$Folder" pull --recurse-submodules --jobs=4
if ($lastExitCode -ne "0") {
write-warning "'git pull' on 📂$FolderName failed"
}
if ($lastExitCode -ne "0") { write-warning "'git pull' on 📂$FolderName failed" }
& git -C "$Folder" submodule update --init --recursive
if ($lastExitCode -ne "0") { throw "'git submodule update' failed" }
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds