1
0
mirror of https://github.com/fleschutz/PowerShell.git synced 2025-04-09 18:19:32 +02:00

Improve pull-repos.ps1 and switch-branch.ps1

This commit is contained in:
Markus Fleschutz 2021-06-17 08:10:44 +02:00
parent f1de21d8fc
commit 882eaf4b29
2 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ try {
foreach ($Folder in $Folders) { foreach ($Folder in $Folders) {
$FolderName = (get-item "$Folder").Name $FolderName = (get-item "$Folder").Name
$Step++ $Step++
"🢃 Pulling 📂$FolderName (step $Step/$FolderCount) ..." "🢃 Pulling #$Step: 📂$FolderName ..."
& git -C "$Folder" pull --recurse-submodules --jobs=4 & 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" }

View File

@ -24,10 +24,10 @@ try {
& git fetch --all --recurse-submodules --jobs=4 & git fetch --all --recurse-submodules --jobs=4
if ($lastExitCode -ne "0") { throw "'git fetch -all --recurse-submodules' failed" } if ($lastExitCode -ne "0") { throw "'git fetch -all --recurse-submodules' failed" }
& git switch "$BranchName" & git checkout --recurse-submodules "$BranchName"
if ($lastExitCode -ne "0") { throw "'git switch $BranchName' failed" } if ($lastExitCode -ne "0") { throw "'git switch $BranchName' failed" }
& git pull & git pull --recurse-submodules
if ($lastExitCode -ne "0") { throw "'git pull' failed" } if ($lastExitCode -ne "0") { throw "'git pull' failed" }
& git submodule update --init --recursive & git submodule update --init --recursive