mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-23 06:08:36 +01:00
Add git submodule update
This commit is contained in:
parent
5e79406090
commit
dc1cf899c2
@ -8,6 +8,7 @@
|
|||||||
param($RepoDir = "$PWD")
|
param($RepoDir = "$PWD")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
"🢃 Pulling updates..."
|
||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||||
@ -20,10 +21,12 @@ try {
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
"🢃 Pulling updates..."
|
|
||||||
& git pull --recurse-submodules --jobs=4
|
& git pull --recurse-submodules --jobs=4
|
||||||
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
|
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
|
$RepoDirName = (get-item "$RepoDir").Name
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ pulled updates for Git repository 📂$RepoDirName in $Elapsed sec"
|
"✔️ pulled updates for Git repository 📂$RepoDirName in $Elapsed sec"
|
||||||
|
@ -25,9 +25,10 @@ try {
|
|||||||
"🢃 Pulling 📂$FolderName..."
|
"🢃 Pulling 📂$FolderName..."
|
||||||
|
|
||||||
& git -C "$Folder" pull --recurse-submodules --jobs=4
|
& git -C "$Folder" pull --recurse-submodules --jobs=4
|
||||||
if ($lastExitCode -ne "0") {
|
if ($lastExitCode -ne "0") { write-warning "'git pull' on 📂$FolderName failed" }
|
||||||
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
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
|
Loading…
Reference in New Issue
Block a user