feat(lib): write progress bars to stderr

This commit is contained in:
Erica Marigold 2025-01-22 12:25:16 +05:30
parent 13cae3a375
commit 6342b5ca87
Signed by: DevComp
GPG key ID: 429EF1C337871656
2 changed files with 2 additions and 2 deletions

View file

@ -281,7 +281,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
if matchingAsset == nil then
if _G.interactive then
-- Clear the current progress bar line
stdio.write("\x1b[2K\x1b[0G")
stdio.ewrite("\x1b[2K\x1b[0G")
end
-- Output warnings

View file

@ -56,7 +56,7 @@ function ProgressBar.start(self: ProgressBarImpl): ()
while not self.finished do
for _, spinner in SPINNERS do
local stage = self.stages[self.currentStageIndex]
stdio.write(
stdio.ewrite(
`\x1b[2K\x1b[0G{stdio.color("cyan")}{spinner} {stage.message}{stdio.color("reset")}{string.rep(
" ",
MAX_MESSAGE_LENGTH - #stage.message