mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-17 18:36:46 +02:00
Improve pull-repos.ps1 and fetch-repos.ps1
This commit is contained in:
parent
355c3428c5
commit
cf1ff0c33b
@ -26,11 +26,12 @@ try {
|
|||||||
$ParentDirName = (get-item "$ParentDir").Name
|
$ParentDirName = (get-item "$ParentDir").Name
|
||||||
"Fetching updates for $FolderCount Git repositories at 📂$ParentDirName..."
|
"Fetching updates for $FolderCount Git repositories at 📂$ParentDirName..."
|
||||||
|
|
||||||
|
[int]$Step = 1
|
||||||
foreach ($Folder in $Folders) {
|
foreach ($Folder in $Folders) {
|
||||||
$FolderName = (get-item "$Folder").Name
|
$FolderName = (get-item "$Folder").Name
|
||||||
"🢃 Fetching 📂$FolderName..."
|
"Step $Step/$FolderCount: 🢃 Fetching 📂$($FolderName)..."
|
||||||
|
|
||||||
& git -C "$Folder" fetch --all --recurse-submodules --jobs=4
|
& git -C "$Folder" fetch --all --recurse-submodules --prune --prune-tags --jobs=4
|
||||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ try {
|
|||||||
[int]$Step = 1
|
[int]$Step = 1
|
||||||
foreach ($Folder in $Folders) {
|
foreach ($Folder in $Folders) {
|
||||||
$FolderName = (get-item "$Folder").Name
|
$FolderName = (get-item "$Folder").Name
|
||||||
"🢃 Pulling 📂$FolderName ($Step/$FolderCount)..."
|
"Step $Step/$FolderCount: 🢃 Pulling 📂$($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" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user