Skip to content

Commit

Permalink
feat: show progress of copy targets
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy committed Aug 15, 2024
1 parent 4d447f0 commit b1bc6e1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CopyDist.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,23 @@ $RunCopyTargets = @(

git clean dist -fdx *> CopyDist.log

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

$CompletedCount = 0

foreach($Target in $RunCopyTargets)
{
Write-Progress -Status "$Target" -Activity "Copying distribution files"
$PcComplete = ($CompletedCount / $RunCopyTargets.Length) * 100
Write-Progress -Id $ProgressId -Status "$Target" -Activity "($($CompletedCount + 1)/$($RunCopyTargets.Length)) Copying distribution files" -PercentComplete $PcComplete
bazel run --ui_event_filters=-info --noshow_progress $Target *>> CopyDist.log
if(-not $?)
{
throw "$Target failed. Check ./CopyDist.log for more details."
}

$CompletedCount += 1
}

Write-Progress -Id $ProgressId -Completed

0 comments on commit b1bc6e1

Please sign in to comment.