build: Fix "Total: undefined" image pull progress report

Change-type: patch
This commit is contained in:
Paulo Castro 2021-05-02 01:06:42 +01:00
parent 579d68a8f0
commit 535a443d7c

@ -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) {