mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-23 14:18:38 +01:00
Update pull-repos.ps1
This commit is contained in:
parent
103dc88d4d
commit
7e2a1c41fd
@ -26,12 +26,12 @@ try {
|
||||
$Folders = (get-childItem "$ParentDir" -attributes Directory)
|
||||
$NumFolders = $Folders.Count
|
||||
$ParentDirName = (get-item "$ParentDir").Name
|
||||
"Found $NumFolders subfolders in 📂$ParentDirName..."
|
||||
"Found $NumFolders subfolders in 📂$ParentDirName... "
|
||||
|
||||
[int]$Step = 1
|
||||
foreach ($Folder in $Folders) {
|
||||
$FolderName = (get-item "$Folder").Name
|
||||
"⏳ Pulling 📂$FolderName... [step $Step/$NumFolders]"
|
||||
"⏳ Pulling 📂$FolderName [step $Step/$NumFolders]... "
|
||||
|
||||
& git -C "$Folder" pull --recurse-submodules --jobs=4
|
||||
if ($lastExitCode -ne "0") { write-warning "'git pull' in 📂$FolderName failed" }
|
||||
@ -43,7 +43,7 @@ try {
|
||||
}
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ pulled $NumFolders Git repositories at 📂$ParentDirName in $Elapsed sec"
|
||||
"✔️ pulled $NumFolders Git repositories at 📂$ParentDirName in $Elapsed sec "
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
|
Loading…
Reference in New Issue
Block a user