diff --git a/CopyDist.ps1 b/CopyDist.ps1 index 1a04125..4303ad9 100755 --- a/CopyDist.ps1 +++ b/CopyDist.ps1 @@ -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