From 535a443d7cb5b88d743e9e1a50667f1d8c79e028 Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Sun, 2 May 2021 01:06:42 +0100 Subject: [PATCH] build: Fix "Total: undefined" image pull progress report Change-type: patch --- lib/utils/compose_ts.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/utils/compose_ts.ts b/lib/utils/compose_ts.ts index 7af13422..5b8d80a4 100644 --- a/lib/utils/compose_ts.ts +++ b/lib/utils/compose_ts.ts @@ -1493,10 +1493,15 @@ function pullProgressAdapter(outStream: Duplex) { error: Error; errorDetail: Error; }) { - if (status != null) { + id ||= ''; + status ||= ''; + const isTotal = id && id.toLowerCase() === 'total'; + if (status) { status = status.replace(/^Status: /, ''); + } else if (isTotal && typeof percentage === 'number') { + status = `Pull progress: ${percentage}%`; } - if (id != null) { + if (id && status && !isTotal) { status = `${id}: ${status}`; } if (percentage === 100) {