Update fetch-repos.ps1 and pull-repos.ps1

This commit is contained in:
Markus Fleschutz 2022-12-31 17:14:52 +01:00
parent 3e0656b356
commit dae684616c
2 changed files with 5 additions and 5 deletions

View File

@ -22,12 +22,12 @@ try {
& git --version
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
$ParentDirName = (Get-Item "$ParentDir").Name
Write-Host "⏳ (2) Checking parent folder 📂$ParentDirName... " -noNewline
Write-Host "⏳ (2) Checking parent folder... " -noNewline
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" }
$ParentDirName = (Get-Item "$ParentDir").Name
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory)
$NumFolders = $Folders.Count
Write-Host "$NumFolders subfolders found"
Write-Host "$NumFolders subfolders"
[int]$Step = 2
foreach ($Folder in $Folders) {
@ -39,7 +39,7 @@ try {
if ($lastExitCode -ne "0") { throw "'git fetch' in $Folder failed with exit code $lastExitCode" }
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ fetched $NumFolders Git repositories in $Elapsed sec."
"✔️ fetched $NumFolders Git repositories in 📂$ParentDirName in $Elapsed sec."
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -27,7 +27,7 @@ try {
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" }
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory)
$NumFolders = $Folders.Count
Write-Host "found $NumFolders subfolders"
Write-Host "$NumFolders subfolders"
[int]$Step = 3
[int]$Failed = 0