Skip to content

Commit b1bc6e1

Browse files
committed
feat: show progress of copy targets
1 parent 4d447f0 commit b1bc6e1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

CopyDist.ps1

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,23 @@ $RunCopyTargets = @(
1212

1313
git clean dist -fdx *> CopyDist.log
1414

15-
Write-Progress -Status "Building copy targets..." -Activity "Copying distribution files"
15+
$ProgressId = Get-Random
16+
Write-Progress -Id $ProgressId -Status "Building copy targets..." -Activity "Copying distribution files"
1617
bazel build $RunCopyTargets -k *>> CopyDist.log
1718

19+
$CompletedCount = 0
20+
1821
foreach($Target in $RunCopyTargets)
1922
{
20-
Write-Progress -Status "$Target" -Activity "Copying distribution files"
23+
$PcComplete = ($CompletedCount / $RunCopyTargets.Length) * 100
24+
Write-Progress -Id $ProgressId -Status "$Target" -Activity "($($CompletedCount + 1)/$($RunCopyTargets.Length)) Copying distribution files" -PercentComplete $PcComplete
2125
bazel run --ui_event_filters=-info --noshow_progress $Target *>> CopyDist.log
2226
if(-not $?)
2327
{
2428
throw "$Target failed. Check ./CopyDist.log for more details."
2529
}
30+
31+
$CompletedCount += 1
2632
}
33+
34+
Write-Progress -Id $ProgressId -Completed

0 commit comments

Comments
 (0)