style(install-windows): filter winget's spinner frames out of the log
Piping winget to Out-Host defeats its carriage-return redraw, so every spinner and progress-bar frame lands as its own line. Filters the frames, keeps the messages. Block characters spelled by code point to keep the file ASCII. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -43,8 +43,17 @@ function Update-SessionPath {
|
||||
function Install-Winget {
|
||||
param([string]$Id, [string]$Label)
|
||||
Write-Step "Installing $Label"
|
||||
# winget animates a spinner ("-\|/") and a block progress bar using carriage
|
||||
# returns to redraw one line in place. Piping it defeats that: PowerShell
|
||||
# splits on the CRs, so every frame arrives as its own line and the log fills
|
||||
# with dozens of lone dashes and bar snapshots. Drop the frames and keep the
|
||||
# sentences. The block characters are spelled by code point because every
|
||||
# .ps1 here must stay ASCII (tests/test_smoke.py enforces it).
|
||||
$bar = "$([char]0x2588)$([char]0x2592)"
|
||||
winget install --id $Id -e --source winget `
|
||||
--accept-package-agreements --accept-source-agreements --disable-interactivity | Out-Host
|
||||
--accept-package-agreements --accept-source-agreements --disable-interactivity |
|
||||
Where-Object { $_ -notmatch "[$bar]" -and $_ -notmatch '^\s*[-\\|/]\s*$' -and $_.Trim() } |
|
||||
Out-Host
|
||||
# winget returns non-zero when the package is already installed / up to date;
|
||||
# that's not a failure for us. Verify presence after refreshing PATH instead.
|
||||
Update-SessionPath
|
||||
|
||||
Reference in New Issue
Block a user