mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-08 22:16:38 +02:00
Improve build-repos.ps1
This commit is contained in:
parent
899a5b0816
commit
5f463f98c5
@ -11,16 +11,17 @@ try {
|
|||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
|
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
|
||||||
set-location $ParentDir
|
|
||||||
|
|
||||||
[int]$Count = 0
|
$Folders = (get-childItem "$ParentDir" -attributes Directory)
|
||||||
get-childItem $ParentDir -attributes Directory | foreach-object {
|
$ParentDirName = (get-item "$ParentDir").Name
|
||||||
& "$PSScriptRoot/build-repo.ps1" "$($_.FullName)"
|
"Building $($Folders.Count) Git repositories at 📂$ParentDirName..."
|
||||||
$Count++
|
|
||||||
|
foreach ($Folder in $Folders) {
|
||||||
|
& "$PSScriptRoot/build-repo.ps1" "$Folder"
|
||||||
}
|
}
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[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
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user