From 5f463f98c5aa84d1c3783a4810c73ad72ea0e82f Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 7 May 2021 14:55:02 +0200 Subject: [PATCH] Improve build-repos.ps1 --- Scripts/build-repos.ps1 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Scripts/build-repos.ps1 b/Scripts/build-repos.ps1 index 51cd5ea5..38d694ef 100755 --- a/Scripts/build-repos.ps1 +++ b/Scripts/build-repos.ps1 @@ -11,16 +11,17 @@ try { $StopWatch = [system.diagnostics.stopwatch]::startNew() if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" } - set-location $ParentDir - [int]$Count = 0 - get-childItem $ParentDir -attributes Directory | foreach-object { - & "$PSScriptRoot/build-repo.ps1" "$($_.FullName)" - $Count++ + $Folders = (get-childItem "$ParentDir" -attributes Directory) + $ParentDirName = (get-item "$ParentDir").Name + "Building $($Folders.Count) Git repositories at 📂$ParentDirName..." + + foreach ($Folder in $Folders) { + & "$PSScriptRoot/build-repo.ps1" "$Folder" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - write-host -foregroundColor green "✔️ built $Count Git repositories at $ParentDir in $Elapsed sec." + "✔️ built $($Folders.Count) Git repositories at 📂$ParentDirName in $Elapsed sec." exit 0 } catch { write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"