mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-14 17:52:44 -04:00
fix: avoid passing infinite width to cli-truncate when streaming lifecycle output (#12750)
* fix: avoid passing infinite width to cli-truncate when streaming lifecycle output cli-truncate 6.1.0 rejects a non-finite width, which crashed the reporter when streaming lifecycle script output (streamLifecycleOutput passes Infinity to mean "do not truncate"). * chore: drop changeset The broken build this fixes was never released, so no release note is needed.
This commit is contained in:
@@ -277,6 +277,9 @@ function formatLine (maxWidth: number, logObj: LifecycleLog): string {
|
||||
|
||||
function cutLine (line: string | undefined, maxLength: number): string {
|
||||
if (!line) return ''
|
||||
// Streamed lifecycle output is printed in full (maxLength is Infinity).
|
||||
// cli-truncate rejects a non-finite width, so skip truncation in that case.
|
||||
if (!Number.isFinite(maxLength)) return line
|
||||
return cliTruncate(line, maxLength)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user